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 the turndown function (background.js). This caused code blocks to lose all indents.
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 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.