blog: take non-labelled code blocks into account
parent
5f790e4b37
commit
3a1520f0db
|
@ -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(®ex_code, "<pre><code class=\"hljs\">");
|
||||
|
||||
// Transform all non-self-refernece links (does not start with "#") to target="_blank"
|
||||
|
|
Loading…
Reference in New Issue