micro-editor / micro-editor/micro

Syntax highlighting fails when include depth greater than 2

Open
#2,089 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description of the problem or steps to reproduce

While using the twig syntax highlighting to edit a file named test.twig, highlighting for HTML and Twig does work, while both CSS and Javascript does not work. Both CSS and Javascript are included in the HTML highlighting file for text between <script></script> and <style></style> tags. I tested the HTML syntax highlighting on a file named test.html with the same exact code and the highlighting is working correctly. My question is whether there is an issue with the depth of these includes or if there is an issue with the twig.yaml syntax highlighting file.

Specifications

Here is the snippet I tested for both html and twig highlighting:

<html>
	<script>
		let a = 1;
	</script>
	<style>
		.class {
			width: 100%;
		}
	</style>
</html>

The structure of the includes from twig.yaml is as follows:

| twig.yaml
    | html.yaml
        | css.yaml
        | js.yaml

Commit hash: cfcb2e45
OS: Ubuntu 20.04.1
Terminal: gnome-terminal

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with runtime/syntax/twig.yaml and trace its includes into html.yaml, css.yaml, and js.yaml. Reproduce the supplied snippet in both test.twig and test.html, then determine why CSS and JavaScript fail through the Twig include chain. Done means CSS and JavaScript highlighting works in Twig files while the existing HTML behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html, javascript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.