Create a lexer for Markless#1195
Merged
alecthomas merged 1 commit intoalecthomas:masterfrom Jan 14, 2026
Merged
Conversation
Markless is an open document markup standard specified at https://shirakumo.org/docs/markless Reference implementations of full parsers, a test suite, sample documents, and more can be found on the same page. This lexer implements a simpler version of Markless without maintaining the standard component and directive stack. It also does not distinguish every possible component type in Markless, as Pygments/Chroma's types lack appropriate markers. Nevertheless the lexer is useful enough to properly mark up syntax constructs in Markless documents, especially aiding in distinguishing syntactical elements from actual textual content at a glance.
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Markless is an open document markup standard specified at
https://shirakumo.org/docs/markless
Reference implementations of full parsers, a test suite, sample documents, and more can be found on the same page.
This lexer implements a simpler version of Markless without maintaining the standard component and directive stack. It also does not distinguish every possible component type in Markless, as Pygments/Chroma's types lack appropriate markers.
Nevertheless the lexer is useful enough to properly mark up syntax constructs in Markless documents, especially aiding in distinguishing syntactical elements from actual textual content at a glance.
The lexer also does not properly handle nesting, as I don't think Pygments/Chroma is capable of that, at least as far as I could tell from the documentation and other parsers? If I'm wrong, please let me know how I can deal with, for example, the following:
Wherein the entire line should be "GenericHeading",
#,**, and//should be "Keyword" andbarshould be both "GenericStrong" and "GenericEmph".Also please let me know if you'd rather have an XML version of the parser. I found the Go version easier to write, so that's what I did. However, I can also transcribe it into XML if necessary.
Thanks a lot for all your work on Chroma!