4 ms·
On the topic of programming blogs, are there any libraries to automatically detect code snippets within text? I know there are some StackOverflow posts talking
by Alex3917 8y ago
On the topic of programming blogs, are there any libraries to automatically detect code snippets within text? I know there are some StackOverflow posts talking about possible approaches to this, but not sure if anyone has actually built an open source solution.
- huntermeyer 8y agohttps://highlightjs.org https://highlightjs.org
- Alex3917 8y agoIt looks like this highlights code within <pre><code> blocks with a color scheme appropriate for the language, but it can't actually detect whether a snippet is code in the first place. This is good to know about, although I personally care more about just displaying code blocks in a different typeface than I do about highlighting them appropriately.