Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes issue #191, #272, and most likely #278
The ugly flattened rendering of code blocks is caused by the removal of the
<code>
element from its owning<pre>
.code.innerText
loses all spacings and linefeeds. In addition, a second fix was needed because all tab characters\t
were stripped in theturndown
function (background.js). This caused code blocks to lose all indents.This part of the fix addresses the site:
The links to Medium articles are a different story. The code in these articles are not proper code blocks.
They look like this:
The code has been pre-processed, and then stuck directly under a
<pre>
tag. No<code>
element present.This is addressed by the second part of the fix which returns the content of
<pre>
elements as text rather than html. However, there is no syntax highlighting due to the missing<code>
element.This addresses:
#278 is most likely fixed too, but I were not able to test this.