Skip to content
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

Handle <br>s inside code blocks. #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emilio
Copy link

@emilio emilio commented Jun 9, 2019

Context: I'm processing some exported code which has code that looks like:

<pre><code>foo<br>bar<br>baz</code></pre>

And turndown is not accounting for those line breaks.

We could use innerText instead of textContent to account for them, but it's not
supported in JSDOM (jsdom/jsdom#1245).

We could implement a crappy version of it which includes newlines generated by
<br>, but it seems better to teach the newline replacement about preformatted
text, and just use the already-processed content instead.

Context: I'm processing some exported code which has code that looks like:

<pre><code>foo<br>bar<br>baz</code></pre>

And turndown is not accounting for those line breaks.

We could use innerText instead of textContent to account for them, but it's not
supported in JSDOM (jsdom/jsdom#1245).

We could implement a crappy version of it which includes newlines generated by
<br>, but it seems better to teach the newline replacement about preformatted
text, and just use the already-processed content instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant