terrylinooo / githuber-md

Markdown editor plugin for WordPress.
GNU General Public License v3.0
610 stars 89 forks source link

Not work Syntax Highlight with prism.js #377

Open AIGregor opened 1 month ago

AIGregor commented 1 month ago

WordPress 6.6.1 Version | 1.16.3

Not work Syntax Highlight on the frontend page. Code block looks like a plan text. Any setting can't help.

Thanks in advance.

jencijanos commented 1 month ago

Prism work on WP 6.6.1, but you need open post for edit a republish it (without changes).

From wp-githuber-md settings page:

If you switch to another highlighter moudle, you have to update every your post to take effect.
Because only the language files defined in the code block will be loaded, not all fat packed file.

Post meta in WP database contains data for the code blocks (program language name, for example ```js. But if syntax highlighting is turned off, the data is simply not saved when publishing and then parts of the script simply don't load. Once enabled syntax highlighter, you simply need to republish the post to update its metadata