wcoder / highlightjs-line-numbers.js

Line numbering plugin for Highlight.js

Home Page:https://wcoder.github.io/highlightjs-line-numbers.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[TinyMCE] line number didn't show

yosafatksatria opened this issue · comments

i dont know if it just me or everyone else having the same issues, i do exactly the guide told me, but the line number didnt showing on line, but when i using singleLine: true, it wrapped to 1 line and showing the line number

heres the pic (the line didn't showing)
image

(pic of singleLine: true)
image

ohh and i'm using tinyMCE as RTE (i have custom the tag, because tinyMCE have p tag instead of pre tag, maybe i'll change my RTE, or anyone have better pluggins?)

here's the code inside script tag

hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad({singleLine: true});

$('p code').each(function (i, block) {
	hljs.highlightBlock(block);
});

its working because of the TinyMCE produce line breaks as <p> , i recommend using CKEditor