Sublime Forum

HTML-CSS-JS-Prettify issues

#1

I have a licensed copy of ST2 and just installed the HTML-CSS-JS-Prettify package.

It seems to work with js and css but cannot seem to handle HTML. It indents the head and then nothing else…

Thoughts?

0 Likes

#2

Hi Kirkbross,

Is it possible you have forgotten to close something? If I use the plugin and the code still looks strange. Most of the time I didn’t close a tag.

Did you highlight all of the desired code? I use jekyll which uses yaml head matter “—”. Yaml will screw up my formatting if I do a select all. I have to be careful to select the html only.

This might be a silly question, but did you make sure you have selected the correct syntax? Some times sublime sniffs the syntax incorrectly and uses haml which will highlight, but will not work with this plugin. To make sure you’re using the correct syntax look on the bottom right of the window.

Sorry if my debugging questions are too obvious. I figured I would ask since these are issues I run into with that particular plugin.

0 Likes

#3

That could likely be it. Is there a (good) package that spots unclosed tags?

I work in a .jsp environment with lots of custom java tags that play havoc with my syntax and linting… so it might not be possible.

0 Likes

#4

Not that I know of. This plugin will not perform well if you are using another language with html. I Typically do a spot check if I notice this plugin is not formatting to my liking. I’ll select < div and it will give you a number at the bottom left of the window then select < /div and make sure the counts match. Also, another practice have only recently started to incorporate into my workflow is adding <!–.wrapper-> at the closing of each class and id.

Hope this helps!

0 Likes