-
Notifications
You must be signed in to change notification settings - Fork 879
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
Content trimming #222
Comments
Not at the moment. What's your use case? |
I should add: whitespace is significant in markdown, so to avoid potential issues when the resulting markdown is parsed, the input is stripped of all insignificant whitespace, and trimmed. For example, if whitespace were not trimmed in |
Hi! I was wondering if you can find a way to only trim content when the element is strong, italic, etc? My use case: |
I have a situation where the HTML is This isn't getting shunted outside of the |
This doesn't have a solution with pure Markdown. It would need to be expressed in HTML and as turndown is a converter to Markdown, it prefers collapsing the whitespace in a manner that doesn't break flanking delimiters, see https://spec.commonmark.org/0.31.2/#emphasis-and-strong-emphasis. HTML also collapses whitespace, it does so in favour of the first whitespace in a collapsable whitespace run. So maybe even HTML does not work as you want, you can try it in your browser:
Actually I wasn't able to reproduce this, you can try it in Turndown's demo site: |
Can't reproduce this, maybe it's because of your rules mentioned below?
Not sure how do And if you need intra-word emphasis, you may want to reconfigure emphasis delimiter to |
Hi,
just a question, is there any way to avoid trimming content during the conversion?
ex.
<p>hello </p>
should be converted in:
hello <-- note the trailing whitespace
Thank you
The text was updated successfully, but these errors were encountered: