index : paprika

A blogging platform written in Rust for Cloudflare Workers, integrated with Standard Notes

diff options
authorPeter Cai <[email protected]>2020-04-15 21:06:30 +0800
committerPeter Cai <[email protected]>2020-04-15 21:06:30 +0800
commit3a1520f0dbe57310a27e0687beec8d8ec18a98d7 (patch)
parent5f790e4b379abfd139e9d90d024c5d726b46af8b (diff)
blog: take non-labelled code blocks into account
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ b/src/
index 7ae4264..6acd57d 100644
--- a/src/
+++ b/src/
@@ -253,7 +253,7 @@ impl PostContentCache {
// We don't match the end tag because it may span multiple lines
// trying to match the end tag could result in accidentally matching
// the end tag of another code block.
- let regex_code = RegExp::new("<pre><code class=\"language-([^\"]*)\">", "ig");
+ let regex_code = RegExp::new("<pre><code( class=\"language-([^\"]*)\")?>", "ig");
let js_html = js_html.replace_by_pattern(&regex_code, "<pre><code class=\"hljs\">");
// Transform all non-self-refernece links (does not start with "#") to target="_blank"