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

Backport split parser changes #56

Merged
merged 9 commits into from
Jan 28, 2025
Merged

Backport split parser changes #56

merged 9 commits into from
Jan 28, 2025

Conversation

treeman
Copy link
Owner

@treeman treeman commented Jan 28, 2025

This backports features and fixes from the split parser experiment but keeping them in a single parser.

This is a major rewrite including:

  • Complete rewrite of inline handling, aimed to resolve Djot's precedence rules
  • Added tree-sitter fields wherever I could, so you can refer to child nodes by names instead of only indexes
  • We're doing more work but performance should be roughly the same, requiring some extra logic to prune branches
  • And fixes for many different parsing problems

Highlight groups have some breaking changes:

  • Removed header1, header2 etc in favor of a header node that can contain an arbitrary level.
  • Superscript, subscript, highlighted, insert, and delete now use named nodes like superscript_begin and superscript_end instead of text nodes like ^ and {^.
  • Standalone comments such as {% comment %} are now captured by the inline_comment node instead of in a comment node (which is used for comments inside an attribute such as in {.class %comment% #id}).
  • image_description now contains the ![ text node for images of all types (previously captured by full_reference_image, collapsed_reference_image, and inline_image)

Closes #41, #42, #43, #44, #45, #46, #49, #50, #52, #53, #54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verbatim inside indented list isn't recognized
1 participant