index : paprika

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

diff options
context:
space:
mode:
authorPeter Cai <[email protected]>2020-04-15 21:06:30 +0800
committerPeter Cai <[email protected]>2020-04-15 21:06:30 +0800
commit3a1520f0dbe57310a27e0687beec8d8ec18a98d7 (patch)
treecbe7e00e2ede6624f0a6289367b6904084f9f03b
parent5f790e4b379abfd139e9d90d024c5d726b46af8b (diff)
downloadpaprika-3a1520f0dbe57310a27e0687beec8d8ec18a98d7.tar.gz
blog: take non-labelled code blocks into account
-rw-r--r--src/blog.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/blog.rs b/src/blog.rs
index 7ae4264..6acd57d 100644
--- a/src/blog.rs
+++ b/src/blog.rs
@@ -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"