forked from CrossDark/CrossDown
1.7.5 外框还有bug
This commit is contained in:
parent
7c7efb8677
commit
09f186799a
@ -257,19 +257,34 @@ class Box(Extension):
|
||||
md.registerExtension(self) # 注册扩展
|
||||
# 红框警告
|
||||
md.inlinePatterns.register(ID(
|
||||
r'!{3,}(.+?)!{3,}', tag='div', property_='style', value='display: inline-block; border: 1px solid red;'
|
||||
), 'warning_in_line', 0
|
||||
) # 行内
|
||||
r'!{3}(.+?)!{3}', tag='div', property_='style', value='display: inline-block; border: 1px solid red;'
|
||||
), 'warning_in_line', 0) # 行内
|
||||
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) # 块
|
||||
|
||||
# 黄框提醒
|
||||
md.inlinePatterns.register(ID(
|
||||
r'!{2,}(.+?)!{2,}', tag='div', property_='style', value='display: inline-block; border: 1px solid yellow;'
|
||||
), 'reminding_in_line', 0
|
||||
) # 行内
|
||||
r'!-!(.+?)!-!', tag='div', property_='style', value='display: inline-block; border: 1px solid yellow;'
|
||||
), 'reminding_in_line', 0) # 行内
|
||||
md.parser.blockprocessors.register(BoxBlock(
|
||||
md.parser, r'^ *!{2,} *\n', r'\n *!{2,}\s*$', 'display: inline-block; border: 1px solid yellow;'
|
||||
md.parser, r'^ *!-! *\n', r'\n *!-!\s*$', 'display: inline-block; border: 1px solid yellow;'
|
||||
), 'reminding_box', 175) # 块
|
||||
|
||||
# 绿框安心
|
||||
md.inlinePatterns.register(ID(
|
||||
r',{3}(.+?),{3}', tag='div', property_='style', value='display: inline-block; border: 1px solid green;'
|
||||
), 'reminding_in_line', 0) # 行内
|
||||
md.parser.blockprocessors.register(BoxBlock(
|
||||
md.parser, r'^ *,{3} *\n', r'\n *,{3}\s*$', 'display: inline-block; border: 1px solid green;'
|
||||
), 'reminding_box', 175) # 块
|
||||
|
||||
# 蓝框怀疑
|
||||
md.inlinePatterns.register(ID(
|
||||
r',-,(.+?),{2}', tag='div', property_='style', value='display: inline-block; border: 1px solid blue;'
|
||||
), 'reminding_in_line', 0) # 行内
|
||||
md.parser.blockprocessors.register(BoxBlock(
|
||||
md.parser, r'^ *,-, *\n', r'\n *,-,\s*$', 'display: inline-block; border: 1px solid blue;'
|
||||
), 'reminding_box', 175) # 块
|
||||
|
||||
|
||||
|
20
README.html
20
README.html
@ -118,6 +118,8 @@
|
||||
<li><a href="#14">14 外框</a><ul>
|
||||
<li><a href="#14.1">14.1 警告</a></li>
|
||||
<li><a href="#14.2">14.2 提醒</a></li>
|
||||
<li><a href="#14.3">14.3 安心</a></li>
|
||||
<li><a href="#14.4">14.4 怀疑</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@ -219,7 +221,7 @@
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
<p>引文内添加klzzwxhklzzwxhklzzwxh:00400037klzzwxh:0038</p>
|
||||
<p>引文内添加klzzwxhklzzwxhklzzwxh:00390036klzzwxh:0037</p>
|
||||
</blockquote>
|
||||
<h1 id="7">7 提纲</h1>
|
||||
<h2 id="7.1">7.1 提纲号</h2>
|
||||
@ -309,9 +311,19 @@
|
||||
<p>这是一条警告</p>
|
||||
</div>
|
||||
<h2 id="14.2">14.2 提醒</h2>
|
||||
<p>这是一个<div style="display: inline-block; border: 1px solid yellow;">提醒</div>……</p>
|
||||
<div style="display: inline-block; border: 1px solid yellow;">
|
||||
<p>这是一条提醒</p>
|
||||
<p>这是一个!-!提醒!-!……</p>
|
||||
<p>!-!
|
||||
这是一条提醒
|
||||
!-!</p>
|
||||
<h2 id="14.3">14.3 安心</h2>
|
||||
<p>这是一个,,,安心,,,……</p>
|
||||
<p>,,,
|
||||
这是一条安心
|
||||
,,,</p>
|
||||
<h2 id="14.4">14.4 怀疑</h2>
|
||||
<p>这是一个,-,怀疑,-,……</p>
|
||||
<div style="display: inline-block; border: 1px solid blue;">
|
||||
<p>这是一条怀疑</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user