add HTMLAttributes to defaultoptions

This commit is contained in:
Philipp Kühn
2020-11-13 16:44:22 +01:00
parent c840a562de
commit 2591ffe419
18 changed files with 173 additions and 26 deletions

View File

@@ -3,6 +3,9 @@ import { textblockTypeInputRule } from 'prosemirror-inputrules'
export interface CodeBlockOptions {
languageClassPrefix: string,
HTMLAttributes: {
[key: string]: any
},
}
export const backtickInputRegex = /^```(?<language>[a-z]*)? $/
@@ -13,6 +16,7 @@ const CodeBlock = createNode({
defaultOptions: <CodeBlockOptions>{
languageClassPrefix: 'language-',
HTMLAttributes: {},
},
content: 'text*',