Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent syntax highlighting for markdown footnotes #87

Open
d0rf3n opened this issue May 5, 2021 · 2 comments
Open

Inconsistent syntax highlighting for markdown footnotes #87

d0rf3n opened this issue May 5, 2021 · 2 comments
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@d0rf3n
Copy link

d0rf3n commented May 5, 2021

The following:

[^1]: [link](yoyoyo.test)
[^2]: [a link](yoyoyo.test)
[^3]: testNoSpace
[^4]: test with space

Highlights as:
image

As long as there is no spaces anytwhere in the footnote definition, the [^#] is scoped as a "constant". As soon as a space is added it scopes as "string.other.link.title.markdown". As can be seen this also affects the highlighting of the rest of the line.

Purple is: markup.underline.link.markdown
Red is: string.other.link
White is: No theme selector
Orange is: constant (constant.other.reference.link.markdown)
Blue is: string.other.link.title.markdown

Expected to keep highlighting the same regardless of footnote content.

@mjbvz mjbvz added this to the Backlog milestone Dec 5, 2022
@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Dec 5, 2022
@gledos
Copy link

gledos commented Jan 26, 2024

I've encountered this issue as well. Due to the extensive use of footnotes in the Markdown documents I write, the visual appearance becomes quite messy.

If footnotes could be recognized correctly, perhaps I could customize their color using the following approach to darken the color, focus more on writing.

"editor.tokenColorCustomizations": {
  "[YOUR COLOR SCHEME]": {
     "textMateRules": [
      {
        "scope": "markup.heading.markdown",
        "settings": {
          "foreground": "#729098",
        }
      }
    ]
  }
}

This method is derived from AnsonH.

@gledos
Copy link

gledos commented Apr 3, 2024

Below is an example with a moderate number of footnotes and reference links. (from wikipedia SIL Open Font License)

The **SIL Open Font License** (or **OFL** in short) is one of the major open font licenses,
which allows embedding, or "bundling",[^4] of the font in commercially sold products.[^5]

[^4]: Spalinger, Nicolas; Gaultney, Victor (November 27, 2023). ["Question: 1.15 What about distributing fonts with a document? Within a compressed folder structure? Is it distribution, bundling or embedding?"](https://openfontlicense.org/ofl-faq/). _OFL-FAQ web version (1.1-update7)_. [SIL International](https://en.wikipedia.org/wiki/SIL_International "SIL International").

[^5]: Garish, Matt; Gylling, Markus (2013). [_Epub 3 Best Practices_](<http://www.uvm.edu/~choman/ebooks/EPUB 3 Best Practices.pdf>) (PDF). [O’Reilly Media, Inc.](https://en.wikipedia.org/wiki/O’Reilly_Media,_Inc. "O’Reilly Media, Inc.") p. 139. [ISBN](https://en.wikipedia.org/wiki/ISBN_(identifier) "ISBN (identifier)") [978-1-449-32914-3](https://en.wikipedia.org/wiki/Special:BookSources/978-1-449-32914-3 "Special:BookSources/978-1-449-32914-3"). [Archived](<https://web.archive.org/web/20191103091907/http://www.uvm.edu/~choman/ebooks/EPUB 3 Best Practices.pdf>) (PDF) from the original on November 3, 2019.

OFL is a [free][] and [open source license][].[^6][^7] It was created by [SIL International][],
the organization behind _[Ethnologue][]_.

[free]: https://en.wikipedia.org/wiki/Free_software_license "Free software license"

[open source license]: https://en.wikipedia.org/wiki/Open_source_license "Open source license"

[^6]: ["OFL fonts"](https://openfontlicense.org/ofl-fonts/). _SIL Open Font License_. Retrieved December 11, 2023.

[^7]: ["Open Source License Comparison Grid"](https://www.cmu.edu/cttec/forms/opensourcelicensegrid.pdf) (PDF). [CMU](https://en.wikipedia.org/wiki/Carnegie_Mellon_University "Carnegie Mellon University"). [Archived](https://web.archive.org/web/20170921141728/http://www.cmu.edu/cttec/forms/opensourcelicensegrid.pdf) (PDF) from the original on September 21, 2017. Retrieved November 3, 2019.

[SIL International]: https://en.wikipedia.org/wiki/SIL_International "SIL International"

[Ethnologue]: https://en.wikipedia.org/wiki/Ethnologue "Ethnologue"

You can see that the content is very confusing and it is difficult to find paragraphs quickly.

It may be possible to place reference content such as footnotes at the bottom of the article, but this actually increases the complexity of editing the text. Because a long text may be hundreds of lines long, the same footnote may be cited multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants