-
Notifications
You must be signed in to change notification settings - Fork 150
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
Handling links for headers #30
Comments
Hi! The whitespace issue is handled in #17 and soon to be closed, the other issue is interesting. Headings are block elements, links are inline. It is best practice not to embed block elements into inline elements. Anchors should not include headings. I can have a look into how simple it would be to make the other way around happen, but I cannot promise a good solution. Best! Alex |
Hi! Thank you for the quick reply. Which release should include the fix #17 for the whitespace issue? My observation is that web browsers do render headers (h1, h2, etc.) with links ( |
Hi, the fix of #17 was released in 0.6.3. Regarding the a/h1 issue: for this we would have to do what browsers do, they read the HTML and apply a multitude of error correction, so that non-standard HTML gets rendered to the best of their abilities. The parser used in this project tries to do this, too, but it seems that this exact issue is not addressed. So we would have to change the DOM tree for all inlines that contain a block -- or we hardcode the exception for a/h1. |
The following code....
generates...
It should generate the following MD instead, isn't it?
#### [Google Search](https://www.google.com)
Also, there are 2 white spaces in front that are unnecessary which confuses reliable MD readers.
Fixing the unnecessary white spaces in front of headers in ATX style and a better handling of the
<a>
tag would allow to generate much higher quality MD output for foundational html tag structures.Thanks!
Sharing a good reference for me: Markdown Reference Guide
The text was updated successfully, but these errors were encountered: