Skip to content

Commit 509b7a2

Browse files
committed
fix: Revert "fix: icon regex to allow numbers to have a hyphen following as longs as that follows with another character (#693)"
This reverts commit ead8f77.
1 parent ead8f77 commit 509b7a2

File tree

5 files changed

+3
-18
lines changed

5 files changed

+3
-18
lines changed

src/steps/rewrite-icons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import { h } from 'hastscript';
1414
import { CONTINUE, SKIP, visit } from 'unist-util-visit';
1515

16-
const REGEXP_ICON = /(?<!(?:https?|urn)[^\s]*):(#?[a-z][a-z\d_-]+[a-z\d]):/gi;
16+
const REGEXP_ICON = /(?<!(?:https?|urn)[^\s]*):(#?[a-z_-]+[a-z\d]*):/gi;
1717

1818
/**
1919
* Create a <span> icon element:

test/fixtures/content/icons-ignored.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@ <h1 id="icons">Icons</h1>
55
<pre><code>:rocket:</code></pre>
66
<p><a href="https://example.test/:urn:">https://example.test/:urn:</a></p>
77
<p>urn:aaid:sc:VA6C2:ac6066f3-fd1d-4e00-bed3-fa3aa6d981d8</p>
8-
<p>:red-check-mark-:</p>
9-
<p>:be:</p>
108
</div>
11-
</main>
9+
</main>

test/fixtures/content/icons-ignored.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@
99
[https://example.test/:urn:](https://example.test/:urn:)
1010

1111
urn:aaid:sc:VA6C2:ac6066f3-fd1d-4e00-bed3-fa3aa6d981d8
12-
13-
:red-check-mark-:
14-
15-
:be:

test/fixtures/content/icons.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@ <h1 id="icons">Icons</h1>
55
<p>Hello <span class="icon icon-red"></span> banner.</p>
66
<p>Hello <span class="icon icon-check"></span> mark.</p>
77
<p>Team<span class="icon icon-rocket"></span>blasting off again.</p>
8-
<p><span class="icon icon-red-check-mark"></span></p>
9-
<p><span class="icon icon-red-check-1"></span></p>
10-
<p><span class="icon icon-red-check-2-mark"></span></p>
118
</div>
12-
</main>
9+
</main>

test/fixtures/content/icons.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,3 @@ Hello :red: banner.
77
Hello :#check: mark.
88

99
Team:rocket:blasting off again.
10-
11-
:red-check-mark:
12-
13-
:red-check-1:
14-
15-
:red-check-2-mark:

0 commit comments

Comments
 (0)