Unsupported diff-* highlighting
See original GitHub issuePrism allows convenient diff line highlighting with preservation of underlying syntax highlighting via a Diff Highlight plugin: https://prismjs.com/plugins/diff-highlight/
However, trying to use it via 11ty via e.g. ```diff-javascript
tag currently fails with
`TemplateContentRenderError` was thrown
> "diff-javascript" is not a valid Prism.js language for eleventy-plugin-syntaxhighlight
`Error` was thrown:
Error: "diff-javascript" is not a valid Prism.js language for eleventy-plugin-syntaxhighlight
at module.exports (/mnt/c/src/web.dev/node_modules/.pnpm/@11ty/eleventy-plugin-syntaxhighlight@3.0.1_@11ty+eleventy@0.11.0/node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/PrismLoader.js:11:11)
...
Looks like this might require some special handling similarly to TypeScript tag?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Diff syntax highlighting in Github Markdown - Stack Overflow
Github's markdown supports diff when formatting code. For example: ```diff public class Hello1 { public static void Main() { - System.
Read more >Skip highlighting cache for diffs with unsupported characters (!69069 ...
Skip a highlighting cache generation for affected diff files. It doesn't fully resolves the problem but it improves the user experience.
Read more >Highlighting a .diff file - TeX - LaTeX Stack Exchange
Update: Diff viewers often highlight the background of lines, instead of coloring the text. This can be added with the help of Martin ......
Read more >What does it do for unsupported languages? Just fall back to ...
Yep! It does a conventional textual diff: run Myers' diff algorithm on lines, then word highlighting on changed lines.
Read more >Syntax Highlighting - Hugo
css; Cython: cython, pyx, pyrex; D: d; Dart: dart; Diff: diff, udiff; Django/Jinja: django, jinja ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Starting with now-available v3.2.1 of this plugin, you can use
diff-
on the prefix of your language and Eleventy will use the official Prism.js diff-highlight plugin. Look to https://www.11ty.dev/docs/plugins/syntaxhighlight/ soon for the official docs on this.Amazing, thanks!