Skip to content

Commit

Permalink
JS-2657: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3orblade committed Apr 22, 2024
1 parent 88e7394 commit c46173b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ts/lib/mark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ class Mark {
fromMarkdown (html: string, marks: I.Mark[], restricted: I.MarkType[], adjustMarks: boolean): { marks: I.Mark[], text: string, adjustMarks: boolean } {
const test = /((^|\s)_|[`\*~\[]){1}/.test(html);
const checked = marks.filter(it => [ I.MarkType.Code ].includes(it.type));
const overlaps = [ I.MarkOverlap.Left, I.MarkOverlap.Right, I.MarkOverlap.Inner, I.MarkOverlap.InnerLeft, I.MarkOverlap.InnerRight ];

if (!test) {
return { marks, text: html, adjustMarks };
Expand Down Expand Up @@ -507,7 +508,8 @@ class Mark {

let check = true;
for (const mark of checked) {
if ((mark.range.from <= from) && (mark.range.to >= to)) {
const overlap = this.overlap({ from, to }, mark.range);
if (overlaps.includes(overlap)) {
check = false;
break;
};
Expand Down

0 comments on commit c46173b

Please sign in to comment.