crayon-syntax-highlighter icon indicating copy to clipboard operation
crayon-syntax-highlighter copied to clipboard

Don't put inline code in <pre> tags in feeds.

Open kzemek opened this issue 12 years ago • 2 comments

Hey, Currently cryon-syntax-highlighter puts all code in <pre> tags when it detects that it's in the feed mode: crayon_wp.class.php:666

if (is_feed()) { // Convert the plain code to entities and put in a <pre></pre> tag $crayon_formatted = CrayonFormatter::plain_code($crayon->code(), $crayon->setting_val(CrayonSettings::DECODE)); } else {

This is incorrect for inline snippets, as <pre> is a block, and inline snippets often occur inside <p> tags. <pre> causes the newline to appear after the snippet, which in turn causes a major readability issue for RSS aggregates such as http://planetkde.org/.

kzemek avatar Jul 01 '13 23:07 kzemek

Are there any updates or workarounds for this issue?

zefanja avatar Dec 13 '17 00:12 zefanja

If you try and modify this condition to if (is_feed() && !$crayon->is_inline()) { does it fix the issue?

aramk avatar Jan 05 '18 19:01 aramk