NiklasPor / prettier-plugin-go-template

Fixes prettier formatting for go templates 🐹
prettier-plugin-go-template-niklaspor.vercel.app
MIT License
343 stars 24 forks source link

confused by multiline comments containing syntax #93

Open josharian opened 2 years ago

josharian commented 2 years ago
  {{/* {{ range $attr := .Attrs }}    
  {{ end }}   */}}

This causes a spurious error:

Error: Encountered unexpected end keyword.

josharian commented 2 years ago

This also happens for comments in other contexts. I also ran across this breakage:

{{ if .B }}
  {{/* if */}}
{{ end }}

yields:

Error: Missing end block.