mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: adds initial support for custom blocks using code fencing (#15743)
Allows to write custom code blocks:
```
```mermaid height=200,foo=bar
test
```
```
Which will then get converted to:
```
<pre data-code-wrap="mermaid" data-code-height="200" data-code-foo="bar">
<code class="lang-nohighlight">
test
</code>
</pre>
```
This commit is contained in:
@@ -34,6 +34,8 @@ describe "CommonMark" do
|
||||
cooked.gsub!(" class=\"lang-auto\"", '')
|
||||
cooked.gsub!(/<span class="hashtag">(.*)<\/span>/, "\\1")
|
||||
cooked.gsub!(/<a name="(.*)" class="anchor" href="#\1*"><\/a>/, "")
|
||||
# we support data-attributes which is not in the spec
|
||||
cooked.gsub!("<pre data-code-startline=\"3\">", '<pre>')
|
||||
# we don't care about this
|
||||
cooked.gsub!("<blockquote>\n</blockquote>", "<blockquote></blockquote>")
|
||||
html.gsub!("<blockquote>\n</blockquote>", "<blockquote></blockquote>")
|
||||
|
||||
Reference in New Issue
Block a user