-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Marked Demo Format Conversion Issue #3525
Comments
As you can see in this demo marked does the same thing as GitHub.
(https://marked.js.org/demo),Marked Demo. For autolinks we try to follow what GitHub would do. In this case it is working as expected. If you would like to change marked to not work like GitHub you can create an extension that changes the autolink tokenizer. Or you can put angle brackets around the link to tell marked where the link should end
(https://marked.js.org/demo),Marked Demo. |
@UziTech Is there a way to ensure that Marked works predictably in all scenarios, without variations due to different input sources? For example, can this be achieved through configuration options or extensions? Additionally, regarding the method of wrapping links in angle brackets, while it can solve some issues, it is not always feasible to manually add angle brackets to user inputs. Are there any more general solutions available? Thanks! |
The problem is that there is no "right" way to do it. Everyone's idea of what is "right" is different. So we have to have a specification that tells us the rules in order for everyone to agree on the right way. For example which punctuation stops an auto link is specified in the GFM spec. You don't seem to agree with that spec so you will have to create your own extension with the rules that you want. I'll be honest this will not be an easy thing to do right as there may be a lot of strange edge cases but you can follow this documentation to learn how to create an extension. |
Marked version:
14.1.3
Describe the bug
The format conversion in the Marked Demo (https://marked.js.org/demo) seems to be incorrect. Specifically, when converting a string containing Chinese punctuation, the resulting HTML is not as expected.
To Reproduce
Steps to reproduce the behavior:
Marked Demo(https://marked.js.org/demo),Marked Demo
.Expected Output:
html Marked Demo(<a href="https://marked.js.org/demo">https://marked.js.org/demo</a>),Marked Demo
Actual Output:
html Marked Demo(<a href="https://marked.js.org/demo%EF%BC%89%EF%BC%8CMarked">https://marked.js.org/demo),Marked</a> Demo
The text was updated successfully, but these errors were encountered: