In Cloud9 IDE you can automatically format HTML codes, or Javascript codes. But once in a while you need to do the formatting not compatible with the containing file type. For example, when you are authoring a web component widget, you need to provide a template, which is HTML structures, in the form of a string variable residing inside a Javascript file. Currently the IDE simply ignore this patch of code, treating it as plain text strings. How can I format the HTMLs in this case? Thanks.
Asked
Active
Viewed 1,126 times
1 Answers
0
The IDE only supports one file format per file, so either Javascript or HTML or PHP, etc. Templating languages like Handlebars, Blade, or others that combine HTML with other languages are not supported for auto-formatting.
If you'd like to format these files, you'll need to do one of the following:
- Use a CLI utility that supports the file type you're trying to cleanup.
- Copy/paste the HTML into a
.html
file, format it there, then paste it back into your original file.
I'd advise you use #1 because #2 doesn't sound fun. The CLI utility you install/use will depend on what types of files you're actually trying to beautify.

Brady Dowling
- 4,920
- 3
- 32
- 62
-
Thanks. Any particular recommendation for HTML inside Javascript? – Jinghui Niu Nov 14 '18 at 21:08
-
It depends on the file type you're using but I can't think of anything off the top of my head, you'd probably just have to Google around for it. – Brady Dowling Nov 16 '18 at 00:09
-
Google led me to here:) – Jinghui Niu Nov 16 '18 at 03:31