However right here’s one other manner: Use CodePen.
Step 1: Copy and paste to CodePen
Say you discovered some code elsewhere, simply copy and paste it in:
Step 2: Modify code indentation settings
If you have already got a CodePen account, you’ve most likely already obtained it arrange, so the default is the way you prefer it. But when it’s not but, regulate it within the Pen Settings space:
The code was 2-spaces as copy/pasted, and now we’re altering that to 4-spaces as a setting.
Step 3: Format the code
You may manually do it right here:
It’s possible you’ll not have to make use of that possibility in any respect for those who save the Pen and have the “Format on Save” possibility on, as it’ll mechanically occur.
It’ll kick over to that new 4-space choice proper fast:
CodePen makes use of Prettier beneath the hood to do that. So you might do that wherever you’ve gotten entry to a working model of Prettier, but it surely could be simpler on CodePen since there’s nothing like enhancing config or something to regulate the way you need it. Prettier has its personal playground as effectively, which is probably going simply as straightforward as CodePen, besides that on CodePen you would possibly have already got your preferences arrange, saving a step.
At Marketing Solution Australia we strive to deliverer elegant responsive websites for your business integrated with our personal SEO Optimization package to bring your pages on the first page of Google.