-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Replace markdown-it
with remark
!
#13
Merged
Merged
Conversation
This file contains 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
…es and their corresponding AST representation ; temporarily disabled some syntax features
…ify a match predicate on nodes
…id it becoming the default block node type
…pdates its dependencies
… step towards using mdast as the intermediate representation for documents
…yChild to catch similar missing-field bugs in the future
…s into one file ; create remark-concrete plugin for remembering source file syntax
…method on EditorConfig
…kable FSAL ; add test cases to ensure this and future changes don't break expected workspace behavior
markdown-it
with remark
🎉 markdown-it
with remark
!
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.
This pull request focuses on replacing the internal
markdown-it
parser withremark
, which I chose for its emphasis on ASTs rather than a token stream representation of the input, making it much easier to build syntax extensions.Replacing the markdown parser required a number of changes:
I wrote a few syntax extensions, including the npm package
@benrbray/remark-cite
, to cover some of the syntax used by Noteworthy which was not already built-in toremark
.I wrote tree transformations to convert from the
mdast
AST format into theprosemirror
document format and back. Noteworthy syntax extensions can easily declare a new node transformation.Workspace plugins (such as the xref plugin, which handles tags/citations) now operate on Markdown ASTs, rather than on ProseMirror documents.
To ensure the correctness of this and future changes, I wrote a number of test cases covering the markdown parser and the behavior of workspaces.
Resolves #2 .