You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p><ahref="https://github.com/domchristie/turndown">This demonstrates turndown – an HTML to Markdown converter in JavaScript.</a></p>
results in
[This demonstrates turndown – an HTML to Markdown converter in JavaScript.](https://github.com/domchristie/turndown)
while
<ahref="https://github.com/domchristie/turndown"><p>This demonstrates turndown – an HTML to Markdown converter in JavaScript.</p></a>
results in
[
This demonstrates turndown – an HTML to Markdown converter in JavaScript.
](https://github.com/domchristie/turndown)
In HTML5, paragraph tags are valid content for anchors tags and while browsers render the HTML snippets above the same Turndown seems to add too much whitespace around the paragraph element when it is a child of an anchor element. They should result in the same markdown without the extra new lines, etc. Thank you.
The text was updated successfully, but these errors were encountered:
Yes, conversions of anchors with block-level elements to markdown presents a problem, since it is often not clear how it should be presented. For example, the following is valid but has no markdown equivalent:
<ahref="#> <h1>Hello world</h1> <p>This whole block is linked</p></a>
We could link the <h1> and not the paragraph, but other situations might not be so straightforward, so it becomes extremely difficult to cater for every case. (There's even a debate as to whether we should be using block links.)
The best option for now is to add a custom rule as suggested in #278 (comment)
results in
while
results in
In HTML5, paragraph tags are valid content for anchors tags and while browsers render the HTML snippets above the same Turndown seems to add too much whitespace around the paragraph element when it is a child of an anchor element. They should result in the same markdown without the extra new lines, etc. Thank you.
The text was updated successfully, but these errors were encountered: