Skip to content

Commit 061e6c5

Browse files
committed
fix: improve markdown italic, underline matching
1 parent 336a65c commit 061e6c5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

examples/languages/test.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ Another inline code: `any`
6767

6868
This is a function_name. Another_One.
6969

70-
Same for__double under__scores
70+
Same for__double under__scores __ **
7171

7272
Within a word*italic*should written like this.
7373

7474
And the**bold**like this.
7575

76+
*test * *test * _test _ _ test_
77+
_ test_ _test _

src/languages/md.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default [
3131
},
3232
{
3333
type: 'kwd',
34-
match: /\b_[^_]*_\b|\*[^*]*\*/g
34+
match: /\b_\S([^\n]*?\S)?_\b|\*\S([^\n]*?\S)?\*/g
3535
},
3636
{
3737
type: 'kwd',

0 commit comments

Comments
 (0)