Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeBehavior does not show line numbers #711

Open
martinmuellerrohde opened this issue Nov 22, 2017 · 1 comment
Open

CodeBehavior does not show line numbers #711

martinmuellerrohde opened this issue Nov 22, 2017 · 1 comment

Comments

@martinmuellerrohde
Copy link

martinmuellerrohde commented Nov 22, 2017

Trying to display line numbers using Code.setShowLineNumbers(true) doesn't work.
The rendered HTML shows a single L0 item instead of L0,L1,L2,... for every line of code.

This is caused by CodeBehavior.createInitializerScript() which changes the prettyfied HTML in line 119 by replacing linebreaks with "
":

return "$('#" + markupId + "').html(PR.prettyPrintOne($('#" + markupId + "').html().replace(/\\r\\n|\\r|\\n/g,'<br>'), '', $('#" + markupId + "').attr('class')));";

This bug can be fixed as follows:
return "$('#" + markupId + "').html(PR.prettyPrintOne($('#" + markupId + "').html(), '', $('#" + markupId + "').attr('class')));";

@martin-g
Copy link
Owner

martin-g commented Dec 1, 2017

Thanks for the report!

Do you mind sending a Pull Request with the fix ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants