question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content is only shown in one column

See original GitHub issue

Here is the code I tested:

<!DOCTYPE html>
<html lang="en">
<head>

<script>
    // Just a lil’ script to show off that inline JS gets highlighted
    window.console && console.log('foo');
</script>
<meta charset="utf-8" />
<link rel="shortcut icon" href="favicon.png" />
<title>Prism</title>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
<script src="prefixfree.min.js"></script>

<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
</head>
<body>

And here is the output: img_2015 06 18_22h10m37s_004_

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
Golmotecommented, Jun 19, 2015

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?

0reactions
TheZokercommented, Jun 23, 2015

Your right, was cached in my browser 😃 Thank you very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Products only showing in one column | WordPress.org
Hello, I am having some trouble setting up the layout. It's only displaying one column and some of the products I would like...
Read more >
Must all content, even if it is just one column, be placed inside ...
No, not all content needs to be placed in .row s. .row s and .col s simply provide you with a customizeable grid...
Read more >
Copy visible cells only - Microsoft Support
Copy visible cells only · Select the cells that you want to copy For more information, see Select cells, ranges, rows, or columns...
Read more >
Show Only Few Rows or Columns - Excel #Shorts - YouTube
If you only wanted to show a limited ranges of columns and rows and have the rest of the worksheet show "empty" space,...
Read more >
Show Only a Few Rows or Columns - YouTube
Want to learn how to hide unused cells in all the columns or the rows? Maybe you want to limit the information to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found