forked from Doist/typist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow all marks to coexist with the Code mark (Doist#309)
- Loading branch information
1 parent
d090558
commit ac06735
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Code } from '@tiptap/extension-code' | ||
|
||
import { CODE_EXTENSION_PRIORITY } from '../../constants/extension-priorities' | ||
|
||
/** | ||
* Custom extension that extends the built-in `Code` extension to allow all marks (e.g., Bold, | ||
* Italic, and Strikethrough) to coexist with the `Code` mark (as opposed to disallowing all any | ||
* other mark by default). | ||
* | ||
* @see https://tiptap.dev/api/schema#excludes | ||
* @see https://prosemirror.net/docs/ref/#model.MarkSpec.excludes | ||
*/ | ||
const RichTextCode = Code.extend({ | ||
priority: CODE_EXTENSION_PRIORITY, | ||
excludes: Code.name, | ||
}) | ||
|
||
export { RichTextCode } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters