forked from CrossDark/CrossDown
1.9.1 代码高亮修bug
This commit is contained in:
parent
922db49b9f
commit
79051ed280
@ -283,7 +283,7 @@ class Box(Extension):
|
|||||||
# 红框警告
|
# 红框警告
|
||||||
md.inlinePatterns.register(ID(
|
md.inlinePatterns.register(ID(
|
||||||
r'!{3}(.+?)!{3}', tag='div', property_='style', value='display: inline-block; border: 1px solid red;'
|
r'!{3}(.+?)!{3}', tag='div', property_='style', value='display: inline-block; border: 1px solid red;'
|
||||||
), 'warning_in_line', 0) # 行内
|
), 'warning_in_line', 20) # 行内
|
||||||
md.parser.blockprocessors.register(BoxBlock(
|
md.parser.blockprocessors.register(BoxBlock(
|
||||||
md.parser, r'^ *!{3} *\n', r'\n *!{3}\s*$', 'display: inline-block; border: 1px solid red;'
|
md.parser, r'^ *!{3} *\n', r'\n *!{3}\s*$', 'display: inline-block; border: 1px solid red;'
|
||||||
), 'warning_box', 175) # 块
|
), 'warning_box', 175) # 块
|
||||||
@ -291,7 +291,7 @@ class Box(Extension):
|
|||||||
# 黄框提醒
|
# 黄框提醒
|
||||||
md.inlinePatterns.register(ID(
|
md.inlinePatterns.register(ID(
|
||||||
r'!-!(.+?)!-!', tag='div', property_='style', value='display: inline-block; border: 1px solid yellow;'
|
r'!-!(.+?)!-!', tag='div', property_='style', value='display: inline-block; border: 1px solid yellow;'
|
||||||
), 'reminding_in_line', 1) # 行内
|
), 'reminding_in_line', 21) # 行内
|
||||||
md.parser.blockprocessors.register(BoxBlock(
|
md.parser.blockprocessors.register(BoxBlock(
|
||||||
md.parser, r'^ *!-! *\n', r'\n *!-!\s*$', 'display: inline-block; border: 1px solid yellow;'
|
md.parser, r'^ *!-! *\n', r'\n *!-!\s*$', 'display: inline-block; border: 1px solid yellow;'
|
||||||
), 'reminding_box', 176) # 块
|
), 'reminding_box', 176) # 块
|
||||||
@ -299,7 +299,7 @@ class Box(Extension):
|
|||||||
# 绿框安心
|
# 绿框安心
|
||||||
md.inlinePatterns.register(ID(
|
md.inlinePatterns.register(ID(
|
||||||
r',{3}(.+?),{3}', tag='div', property_='style', value='display: inline-block; border: 1px solid green;'
|
r',{3}(.+?),{3}', tag='div', property_='style', value='display: inline-block; border: 1px solid green;'
|
||||||
), 'reminding_in_line', 2) # 行内
|
), 'reminding_in_line', 22) # 行内
|
||||||
md.parser.blockprocessors.register(BoxBlock(
|
md.parser.blockprocessors.register(BoxBlock(
|
||||||
md.parser, r'^ *,{3} *\n', r'\n *,{3}\s*$', 'display: inline-block; border: 1px solid green;'
|
md.parser, r'^ *,{3} *\n', r'\n *,{3}\s*$', 'display: inline-block; border: 1px solid green;'
|
||||||
), 'reminding_box', 177) # 块
|
), 'reminding_box', 177) # 块
|
||||||
@ -307,7 +307,7 @@ class Box(Extension):
|
|||||||
# 蓝框怀疑
|
# 蓝框怀疑
|
||||||
md.inlinePatterns.register(ID(
|
md.inlinePatterns.register(ID(
|
||||||
r',-,(.+?),{2}', tag='div', property_='style', value='display: inline-block; border: 1px solid blue;'
|
r',-,(.+?),{2}', tag='div', property_='style', value='display: inline-block; border: 1px solid blue;'
|
||||||
), 'reminding_in_line', 3) # 行内
|
), 'reminding_in_line', 23) # 行内
|
||||||
md.parser.blockprocessors.register(BoxBlock(
|
md.parser.blockprocessors.register(BoxBlock(
|
||||||
md.parser, r'^ *,-, *\n', r'\n *,-,\s*$', 'display: inline-block; border: 1px solid blue;'
|
md.parser, r'^ *,-, *\n', r'\n *,-,\s*$', 'display: inline-block; border: 1px solid blue;'
|
||||||
), 'reminding_box', 178) # 块
|
), 'reminding_box', 178) # 块
|
||||||
|
@ -85,6 +85,7 @@
|
|||||||
<li><a href="#4.2.1">4.2.1 YAML</a></li>
|
<li><a href="#4.2.1">4.2.1 YAML</a></li>
|
||||||
<li><a href="#4.2.2">4.2.2 Python</a></li>
|
<li><a href="#4.2.2">4.2.2 Python</a></li>
|
||||||
<li><a href="#4.2.3">4.2.3 Mermaid</a></li>
|
<li><a href="#4.2.3">4.2.3 Mermaid</a></li>
|
||||||
|
<li><a href="#4.2.4">4.2.4 shell</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -196,7 +197,8 @@
|
|||||||
</code></pre></div>
|
</code></pre></div>
|
||||||
|
|
||||||
<h3 id="4.2.2">4.2.2 Python</h3>
|
<h3 id="4.2.2">4.2.2 Python</h3>
|
||||||
<div class="codehilite"><pre><span></span><code class="python"><span class="nb">print</span><span class="p">(</span><span class="s1">'CrossDown'</span><span class="p">)</span>
|
<div class="codehilite"><pre><span></span><code class="python"><span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
|
||||||
|
<span class="nb">print</span><span class="p">(</span><span class="s1">'CrossDown'</span><span class="p">)</span>
|
||||||
</code></pre></div>
|
</code></pre></div>
|
||||||
|
|
||||||
<h3 id="4.2.3">4.2.3 Mermaid</h3>
|
<h3 id="4.2.3">4.2.3 Mermaid</h3>
|
||||||
@ -207,6 +209,10 @@
|
|||||||
C-->|结果2|E[结束2]
|
C-->|结果2|E[结束2]
|
||||||
</code></pre></div>
|
</code></pre></div>
|
||||||
|
|
||||||
|
<h3 id="4.2.4">4.2.4 shell</h3>
|
||||||
|
<div class="codehilite"><pre><span></span><code class="shell"><span class="nb">cd</span><span class="w"> </span>../..
|
||||||
|
</code></pre></div>
|
||||||
|
|
||||||
<h1 id="5">5 转义</h1>
|
<h1 id="5">5 转义</h1>
|
||||||
<p>\ </p>
|
<p>\ </p>
|
||||||
<p>\a </p>
|
<p>\a </p>
|
||||||
|
@ -131,6 +131,7 @@ B:
|
|||||||
4.2.2 Python
|
4.2.2 Python
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
def main():
|
||||||
print('CrossDown')
|
print('CrossDown')
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -144,6 +145,12 @@ graph TD
|
|||||||
C-->|结果2|E[结束2]
|
C-->|结果2|E[结束2]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
4.2.4 shell
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd ../..
|
||||||
|
```
|
||||||
|
|
||||||
5 转义
|
5 转义
|
||||||
|
|
||||||
\\
|
\\
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
Markdown>=3.7
|
Markdown>=3.7
|
||||||
matplotlib>=3.9.2
|
matplotlib>=3.9.2
|
||||||
numpy>=2.1.1
|
numpy>=2.1.1
|
||||||
|
pygments>=2.18.0
|
Loading…
Reference in New Issue
Block a user