fix markInputRules for italics mark
add another layer of matching by introducing support for second match group since javascript (at least in current browsers) still lacks lookbehind in regex so now supports /nomatch(markstart(text)markend)nomatch/ and still supports the /markstart(text)markend/ syntax all `nomatch` will be kept as is so kindof simulating lookbehinds
This commit is contained in:
@@ -30,7 +30,8 @@ export default class Italic extends Mark {
|
||||
|
||||
inputRules({ type }) {
|
||||
return [
|
||||
markInputRule(/(?:^|[^*_])(?:\*|_)([^*_]+)(?:\*|_)$/, type),
|
||||
markInputRule(/(?:^|[^_])(_([^_]+)_)$/, type),
|
||||
markInputRule(/(?:^|[^*])(\*([^*]+)\*)$/, type),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user