crowdfavorite / wp-capsule

The developer's code journal (built on WordPress)
https://crowdfavorite.com/capsule/
GNU General Public License v2.0
172 stars 27 forks source link

Empty Lines within PHP Tags in Capsule Editor #18

Closed stevenkword closed 11 years ago

stevenkword commented 11 years ago

PHP code blocks separated by a blank line containing no whitespace will break the preview view of the post on the front page.

Use the following example will reproduce the bug.

<?php
$hello = 'foo';

$world = 'bar';
?>
alexkingorg commented 11 years ago

Are you using fenced code blocks?

$hello = 'foo';

$world = 'bar';
alexkingorg commented 11 years ago

Looks like an issue with the syntax highlighting library. If anyone would like to poke around and see if you can generate a patch, that would be awesome.

stevenkword commented 11 years ago

I am using fenced in code blocks. I just installed this application but I am already suspecting it might make its way into my workflow. Congrats to you and your team for doing such an outstanding job. I'll take a look at the syntax highlighter and do some testing.

alexkingorg commented 11 years ago

Thanks for the kind words!

The HTML source is correct, so it does look like the syntax highlighter is the culprit here. For now, a workaround is to omit the ?php tags and just use ```php for the fenced code blocks. Then everything works as expected.

alexkingorg commented 11 years ago

May be related to #16?

ziz commented 11 years ago

This appears to have been related to egil/php-markdown-extra-extended#4, which we have now (hopefully) patched in our fork.