MCPcopy Create free account
hub / github.com/docusealco/docuseal / toggleMark

Function toggleMark

app/javascript/elements/html_editor.js:193–213  ·  view source on GitHub ↗
(name, renderTag, parseRules, shortcuts)

Source from the content-addressed store, hash-verified

191 })
192
193 const toggleMark = (name, renderTag, parseRules, shortcuts) => Mark.create({
194 name,
195 parseHTML () {
196 return parseRules
197 },
198 renderHTML () {
199 return [renderTag, 0]
200 },
201 addCommands () {
202 const commandName = `toggle${name[0].toUpperCase()}${name.slice(1)}`
203
204 return {
205 [commandName]: () => ({ commands }) => commands.toggleMark(name)
206 }
207 },
208 addKeyboardShortcuts () {
209 return {
210 [shortcuts]: () => this.editor.commands.toggleMark(name)
211 }
212 }
213 })
214
215 const Heading = Node.create({
216 name: 'heading',

Callers 1

buildExtensionsFunction · 0.85

Calls 1

createMethod · 0.45

Tested by

no test coverage detected