-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Content is only shown in one column #598
Comments
Thanks for reporting. |
Hey @TheZoker, I think your new lines might be getting stripped. If you look at the source code (view-source:http://demo.comboot.io/viewtopic.php?style=2&f=2&t=7&p=66#p66) from the original issue you reported: <div class="content">
<dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><pre class="line-numbers"><code class="language-markup"><?php <br /> Print "Hello, World!";<br /> ?> <br /><br /> <?php <br /> Echo "Hello, World!";<br /> ?><br /></code></pre></dd></dl>
</div> It looks like it's all in one line in the markup, so Prism will display it in kind. Let me know if I'm off base, though! |
Oh, sorry I didn't see the other issue on the other repo. |
I think you might fix your issue with a little hook like the following (to be inserted after Prism main script): Prism.hooks.add('before-highlight', function(env) {
env.element.innerHTML = env.element.innerHTML.replace(/<br\s*\/?>/g,'\n');
env.code = env.element.textContent.replace(/^(?:\r?\n|\r)/,'');
}); @LeaVerou Should we handle this in the official release? |
Hi, thanks for the fast answer :) |
The version of Prism you're using seems quite outdated. Have you tried to redownload it from http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript&plugins=line-numbers+autolinker ? |
I re-downloaded it and same issue :/ |
Be sure to empty your browser cache. I can no longer reproduce the issue on the two links you posted previously: http://demo.comboot.io/viewtopic.php?style=2&f=2&t=34 http://demo.comboot.io/viewtopic.php?style=2&f=2&t=7&p=66#p66 |
Your right, was cached in my browser :) |
Here is the code I tested:
And here is the output:
The text was updated successfully, but these errors were encountered: