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.

Provide a `| highlight` filter as well?

See original GitHub issue

Issue Description

The paired shortcode is great when I know that an entire block rendered in my template will be code - but sometimes I’m rendering arbitrary markdown that might have code blocks nested inside. In that case, I’d love to do something like:

{{ data | markdown | highlight | safe }}

For now, I’ll try importing prism as a stand-alone in addition to eleventy-plugin-syntaxhighlight - and use it to generate a custom filter (or tag along on my markdown filter).

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:9
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

mirisuzannecommented, Jun 28, 2022

@zachleat I don’t think that quite solves the initial issue here - which is that only some of the content might involve fenced code, and only that code should be highlighted. If I understand this right, it would turn the entire content into a code-block instead.

schneyracommented, May 1, 2020

I’d love this, too. I’m using a CMS as source for my blogposts and it delivers pre-rendered HTML where code is embedded.

<pre class="language-css"><code>[...]</code><pre>

I hope I haven’t overlooked anything, but I’d like to do something like {{ article.content | highlight | safe }}.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create Advanced Highlight Actions - Tableau Help
This option works well for highlight and filter actions within a dashboard. Select - Click a mark in the view to run the...
Read more >
How Can I Apply Both A Filter and Highlight in a View
Yes, you are correct that you can only apply one filter at a time. And you are correct that you would need to...
Read more >
Using a brightness() filter to generically highlight content
DigitalOcean provides cloud products for every stage of your journey. Get started with $200 in free credit! Rick Strahl: I can't tell you...
Read more >
Introducing a New Highlighting User Experience in Tableau
An Innovative Way to Highlight a Dimension Member within a Tableau ... However, instead of providing links to all seventeen sub-categories, I will...
Read more >
Highlighters highlight filter parts · Issue #16705 - GitHub
Highlighters highlight filter parts #16705 ... query part in 1.7 and previous versions, while now filters get highlighted as well with 2.0+.
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 Post

No results found

github_iconTop Related Hashnode Post

No results found