aramk / crayon-syntax-highlighter

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
https://wordpress.org/plugins/crayon-syntax-highlighter/
GNU General Public License v3.0
1.1k stars 248 forks source link

Extra blank line is added to the end #290

Open jyuhuan opened 9 years ago

jyuhuan commented 9 years ago

I am using Crayon syntax highlighter with the markdown support from Jetpack. The following code in my post:

```java
int a = 0;


is rendered by Crayon as:
![image](https://cloud.githubusercontent.com/assets/4944003/8896808/51d507e6-33d5-11e5-88b1-aba3708c29c1.png)

How do I remove that extra blank line at the end?
aramk commented 9 years ago

There's an option to trim the whitespace which should be on to avoid this situation. Ensure you don't have any unusual whitespace characters after the semicolon.

jyuhuan commented 9 years ago

I am sure that the box before the option Remove whitespace surrounding the shortcode content is ticked. I typed that code by hand, so there is no unusual white space characters after the semicolon.

daseinpwt commented 8 years ago
int a = 0;

that will work

aramk commented 8 years ago

Yeah, I'm not sure how Jetpack is rendering it, but I suspect it may be to do with extra code tags or something.

wqshen commented 8 years ago

I also encounter this question, hope improve it

tweh commented 8 years ago

Hi, are there any news on this question? I’m using your plugin together with JetPack (at http://tex.tips) and it would be great to get rid of the blank line :-)

Meligy commented 8 years ago

This is related to https://github.com/aramk/crayon-syntax-highlighter/issues/193#issuecomment-212771990.

My workaround for now is to set decode true in Crayon, and use <pre class="lang:...;"> around my code just before publishing, and make sure it's not intended because <pre> would pick that up (as Markdown is not processing the 4 spaces anymore).

It would be awesome if Crayon can ignore the <pre> in the <pre><code> combination written by JetPack, maybe with an option or something.