Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
fix: Cannot use multiple underscore characters within inline code mark (
Browse files Browse the repository at this point in the history
  • Loading branch information
tommoor authored Sep 30, 2020
1 parent 99403f8 commit 2ae5b7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/lib/markInputRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export default function(
const textStart = matchStart + match[m - 1].lastIndexOf(match[m]);
const textEnd = textStart + match[m].length;

const excludedMarks = getMarksBetween(start, end, state).filter(
item => item.end > matchStart
);
const excludedMarks = getMarksBetween(start, end, state)
.filter(item => item.mark.type.excludes(markType))
.filter(item => item.end > matchStart);

if (excludedMarks.length) {
return tr;
return null;
}

if (textEnd < matchEnd) {
Expand Down
2 changes: 1 addition & 1 deletion src/marks/Code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class Code extends Mark {

get schema() {
return {
excludes: "strong em link mark strikethrough",
excludes: "_",
parseDOM: [{ tag: "code" }],
toDOM: () => ["code", { spellCheck: false }],
};
Expand Down

0 comments on commit 2ae5b7a

Please sign in to comment.