Prettier plugin hubl VSC

I have a problem with two things:
1. The parser formats each attribute to a new line, which is cool for Hubl but not for HTML. For example, embedding a large SVG file.
2. I also have a problem with it sometimes replacing code. e.g

{{ post.post_body|regex_replace("{%\\s*module_block.*?end_module_block\\s*%}", "", "si")|striptags|truncatehtml(250, "...", false) }}

to

Dawidk_2-1763982117994.png

I’m using “@hubspot/prettier-plugin-hubl”: “^0.3.5”

Is this still being developed?

Hey @Dawidk,

tried it quite a while ago, but as it did basically nothing, decided to throw it into the wilds.

Got much better results with the config of VSCode/Cursor like described on the GitHub page of the extension.

p.s. There’s no such setting visible (at least for me), but you can edit/create a .vscode/settings.json in your project and put following code into it

{
 "files.associations": {
 "html-hubl": "html",
 "css-hubl": "css",
 "*.html": "html-hubl",
 "*.css": "css-hubl"
 }
}

This will stop Prettier do weird stuff to your HubL codes while keeping a nice format

edit:
I don’t think this extension is being developed anymore as I couldn’t find anything while looking for “HubL Prettier”.

Best,

Anton