highlight.js
highlight.js copied to clipboard
HAML syntax highlighting broken
Describe the issue HAML syntax highlighting is broken
Codepen
This issue was previously reported (https://github.com/highlightjs/highlight.js/issues/1435) and closed, but the issue does not seem to be fixed.


Which language seems to have the issue? HAML
Sample Code to Reproduce
!!! 5
%html
%body
%h1.foo-bar This works fine
%span.hello.world syntax is fine here
.broken{ broken: 'yes' }
%anything.working{ working: 'fine' }
.also-broken
.i-am-broken
.me-too
%h1.good All good!
Expected behavior (Rouge example)

Additional context Same issue with HAML mixed with Ruby:

I'm wondering if the . and % should be part of the match or not? (if not, probably punctuation?)
We could take some inspiration from Rouge, they seem to make . and % part of the match, your example above looks good too (i.e. only make . part of the match).