-
Notifications
You must be signed in to change notification settings - Fork 119
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
make output markdown keep original indentation of the 1st line in a list item #196
Labels
Milestone
Comments
allets
added a commit
to allets/mistletoe
that referenced
this issue
Nov 6, 2023
…in a list item (miyuchina#196) record indentation on list item to make Markdown renderer be able to render list markers followed by 1~4 spaces.
allets
added a commit
to allets/mistletoe
that referenced
this issue
Nov 6, 2023
…in a list item (miyuchina#196) record indentation on list item to make Markdown renderer be able to render list markers followed by 1~4 spaces.
allets
added a commit
to allets/mistletoe
that referenced
this issue
Nov 27, 2023
…ina#196) A list item such as ` - list item` consists of margin indentation (A), a list marker (B), 1-4 spaces (C) and contents. The old code recorded the width from A to C as `ListItem.prepend` and B as `ListItem.leader`, but the Markdown renderer always skipped margin indentation and output exactly just 1 space after every list marker, such as `- list item`. After this change, the width of A is recorded as `ListItem.indentation`, so that the Markdown renderer can correctly restore both A and C. But the formatting features of other tokens skip margin indentation (A), for consistency of all formatting features, the Markdown renderer only restores C, such as `- list item`.
pbodnar
pushed a commit
that referenced
this issue
Nov 28, 2023
A list item such as ` - list item` consists of margin indentation (A), a list marker (B), 1-4 spaces (C) and contents. The old code recorded the width from A to C as `ListItem.prepend` and B as `ListItem.leader`, but the Markdown renderer always skipped margin indentation and output exactly just 1 space after every list marker, such as `- list item`. After this change, the width of A is recorded as `ListItem.indentation`, so that the Markdown renderer can correctly restore both A and C. But the formatting features of other tokens skip margin indentation (A), for consistency of all formatting features, the Markdown renderer only restores C, such as `- list item`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
input markdown:
Markdown renderer output (v1.2.1):
I expect the output of Markdown renderer to be the same as the input.
My use case:
I developed a tool to replace image links with local paths after downloading these images.
I plan to use a parser.
If it keeps the original format as much as possible, then users can easily check the necessary differences.
And I found the great project, mistletoe!
Thanks for your contributions to the project.
The text was updated successfully, but these errors were encountered: