Syntax highlighting glitch
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 303
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
Long lines can sometimes confuse the parser:
{{#if active}}<span>{{else}}<a {{#if id}}id="{{id}}"{{/if}} href="{{{url}}}">{{/if}}{{#if img}}<img class="desaturate" id="{{img.id}}" src="{{img.src}}" alt="{{img.alt}}" width="{{img.width}}" height="{{img.height}}" />{{/if}}{{name}}{{#if active}}</span>{{else}}</a>{{/if}}
The img closing bracket /> is where highlighting messes up and mistakenly highlights that and the rest of the line as HTML attribute color.
Whereas GitHub's own syntax highlighting correctly highlights the whole line!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the Handlebars template in the issue as the reproduction case and inspect the syntax-highlighting grammar or parser entry point that handles nested tags and long lines. Compare its output with GitHub's highlighting; done when the img closing bracket and the remainder of the line are no longer incorrectly colored as HTML attributes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- handlebars
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100