fix: Allow strikethrough of inline code (#5207

* fix: Allow strikethrough of inline code

* Remove unneccessary change
This commit is contained in:
Tom Moor
2023-04-17 22:26:36 -04:00
committed by GitHub
parent f2b3524d87
commit 746f4e4150
2 changed files with 35 additions and 15 deletions

View File

@@ -52,6 +52,31 @@ export default class ExtensionManager {
);
}
get marks() {
const marks = this.extensions
.filter((extension) => extension.type === "mark")
.reduce(
(marks, mark: Mark) => ({
...marks,
[mark.name]: mark.schema,
}),
{}
);
for (const i in marks) {
if (marks[i].excludes) {
// We must filter marks from the excludes list that are not defined
// in the schema for the current editor.
marks[i].excludes = marks[i].excludes
.split(" ")
.filter((m: string) => Object.keys(marks).includes(m))
.join(" ");
}
}
return marks;
}
serializer() {
const nodes = this.extensions
.filter((extension) => extension.type === "node")
@@ -104,18 +129,6 @@ export default class ExtensionManager {
return new MarkdownParser(schema, makeRules({ rules, plugins }), tokens);
}
get marks() {
return this.extensions
.filter((extension) => extension.type === "mark")
.reduce(
(marks, { name, schema }: Mark) => ({
...marks,
[name]: schema,
}),
{}
);
}
get plugins() {
return this.extensions
.filter((extension) => "plugins" in extension)