Per the CommonMark spec, single backtick (inline) code blocks produce <p><code>....</code></p> tags without honoring new lines, while multiple backtick (block) code blocks produce <pre><code>...</code></pre> tags, keeping new lines.
Going the other way, we should only convert to a multiple-backticks code block if the <code> tag is inside a <pre> tag. By himself, a HTML <code> tag is inline and doesn't show new lines, only the <pre> tag confers this ability.
This PR also removes references to PHP_EOL where \n was mostly used.
Fixes #26 Fixes #70 Undoes most incompatible behavior of #102 Fixes #140 Fixes #161 Blocks https://github.com/friendica/friendica/pull/5765#issuecomment-422097903
Per the CommonMark spec, single backtick (inline) code blocks produce
<p><code>....</code></p>
tags without honoring new lines, while multiple backtick (block) code blocks produce<pre><code>...</code></pre>
tags, keeping new lines.Going the other way, we should only convert to a multiple-backticks code block if the
<code>
tag is inside a<pre>
tag. By himself, a HTML<code>
tag is inline and doesn't show new lines, only the<pre>
tag confers this ability.This PR also removes references to
PHP_EOL
where\n
was mostly used.Tests have been updated.