NiklasPor / prettier-plugin-go-template

Fixes prettier formatting for go templates 🐹

Home Page:prettier-plugin-go-template-niklaspor.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quotation marks inside of attributes

earthboundkid opened this issue · comments

If I have a template command that uses quotation marks inside of an HTML attribute, like <div data-x='{{ doThing "whatever" }}'>, I like for the outer quotation marks to be a single quote ' so that my text editor (which doesn't know about Go templates) highlights the block semi-correctly, but the plugin changes it to be a double quote ".

Okay, my workaround has been to use backticks like

<a href="{{ thing `whatever` }}">hi</a>

That highlights better than using double quotes.