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

Highlighting does not work in WordPress 4.0.1

Open heinrichvk opened this issue 9 years ago • 5 comments

With the installation of a new wordpress theme (went from Divi to Enfold) the highlighting stopped working in a strange way.

It works perfectly well in the preview of the page, but when the page is actually published nothing is highlighted at all.

The logs show the following:

[Crayon Syntax Highlighter Log Entry - 10:37:29 AM - 28 Nov 2014] [SYSTEM LOG] 'Updated from 2.6.8 to _2.6.9_beta' [Crayon Syntax Highlighter Log Entry - 10:38:12 AM - 28 Nov 2014] [SYSTEM LOG] 'Upload directory is empty: cannot load languages.' [SYSTEM LOG] 'The resource directory is missing, should be at ''.' [CrayonUtil::lines()] 'Cannot read lines at 'default/default.txt'.' [Crayon Syntax Highlighter Log Entry - 10:38:18 AM - 28 Nov 2014] [SYSTEM LOG] 'Upload directory is empty: cannot load languages.' [SYSTEM LOG] 'The resource directory is missing, should be at ''.' [CrayonUtil::lines()] 'Cannot read lines at 'default/default.txt'.'

How can I solve this issue?

I am using all the default crayon settings and using the javascript language. I have tried to disable all other plugins and tried reinstalling the plugin through wordpress, this did not help. Tried both the latest version downloaded through wordpress and the beta version.

heinrichvk avatar Nov 28 '14 10:11 heinrichvk

I'm having the same issue and would love to figure this out.

davidvasandani avatar Dec 12 '14 17:12 davidvasandani

This is related to https://github.com/aramk/crayon-syntax-highlighter/issues/172 and https://github.com/aramk/crayon-syntax-highlighter/issues/166. We weren't able to fully determine the cause of the issues, but subsequent version updates fixed the issue for those users.

aramk avatar Dec 13 '14 00:12 aramk

I'm getting a similar issue on both a site running 4.0.1 and 4.1.1, although the highlighting doesn't work on either preview or in publication (see below).

image

It appears as if the code elements are getting classes appended to them correctly:

image

However, the highlighting itself doesn't happen. Is it possible some CSS rules aren't being included for some reason? If the individual span classes are supposed to have CSS rendered, they aren't - see the screenshot below:

image

I was getting an issue with Go loading ([CrayonUtil::lines()] 'Cannot read lines at '/langs/go/statement.txt'.') and fixed it by renaming go.txt to statement.txt, but this appears to have no bearing on the rendering problem.

jgerminario avatar Feb 20 '15 03:02 jgerminario

Hi, I have a similiar issue. I'm using the Enfold Theme and the highlighting only works with ?preview=true.

Does someone know what the difference is when setting the preview flag in the URL?

niondir avatar Dec 01 '16 10:12 niondir

I'm getting this error in the log:

[Crayon Syntax Highlighter Log Entry - 10:55:56 AM - 01 Dec 2016]

 [SYSTEM LOG] 'Upload directory is empty:  cannot load languages.'
 [SYSTEM LOG] 'The resource directory is missing, should be at \'\'.'
 [CrayonUtil::lines()] 'Cannot read lines at \'default/default.txt\'.'

The php script already fails to prepare the HTML output.

Crayon Version 2.8.4 WordPress 4.6.1 Enfold Theme Version: 3.8

niondir avatar Dec 01 '16 11:12 niondir