Closed raphael-inglin-ergon closed 1 year ago
Thanks for report. Please raise a PR, I will try to merge it soon.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in the thread.
What happened?
When using markdown syntax to e.g. write bold text by typing
**bold text**
it will be replaced to show **bold text* instead of bold text. Same applies to italics. This can be easily reproduced in the demo application: https://ngx-editor.stackblitz.io/.Potential Cause & Solution
After a quick look at the code, I think the issue comes from the regex patterns in
defaultPlugins.ts
combined with the application of those rules inmarkInputRule.ts
. All groups in the regex patterns are non-capturing, so theif(match[2])
branch is never executed and the wrong range is being replaced. It could probably be fixed by using capturing groups at the right place or using named groups.Version
15.3.0
Angular Version
16.1.0
What browsers are you seeing the problem on?
No response
Link to reproduce
https://ngx-editor.stackblitz.io/
Relevant log output
No response
Willing to submit a PR?
Yes