@tiptap/extension-paragraph
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4
@@ -6,2 +6,10 @@ # Change Log | ||
# [2.0.0-alpha.4](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-paragraph@2.0.0-alpha.3...@tiptap/extension-paragraph@2.0.0-alpha.4) (2020-12-02) | ||
**Note:** Version bump only for package @tiptap/extension-paragraph | ||
# [2.0.0-alpha.3](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-paragraph@2.0.0-alpha.2...@tiptap/extension-paragraph@2.0.0-alpha.3) (2020-11-19) | ||
@@ -8,0 +16,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@tiptap/core")):"function"==typeof define&&define.amd?define(["@tiptap/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["@tiptap/extension-paragraph"]=t(e["@tiptap/core"])}(this,(function(e){"use strict";return e.Node.create({name:"paragraph",defaultOptions:{HTMLAttributes:{}},group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML:({HTMLAttributes:e})=>["p",e,0],addCommands:()=>({setParagraph:()=>({commands:e})=>e.toggleBlockType("paragraph","paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@tiptap/core")):"function"==typeof define&&define.amd?define(["@tiptap/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["@tiptap/extension-paragraph"]=t(e["@tiptap/core"])}(this,(function(e){"use strict";return e.Node.create({name:"paragraph",defaultOptions:{HTMLAttributes:{}},group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.toggleNode("paragraph","paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})})); | ||
//# sourceMappingURL=tiptap-extension-paragraph.bundle.umd.min.js.map |
@@ -18,3 +18,3 @@ 'use strict'; | ||
renderHTML({ HTMLAttributes }) { | ||
return ['p', HTMLAttributes, 0]; | ||
return ['p', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]; | ||
}, | ||
@@ -27,3 +27,3 @@ addCommands() { | ||
setParagraph: () => ({ commands }) => { | ||
return commands.toggleBlockType('paragraph', 'paragraph'); | ||
return commands.toggleNode('paragraph', 'paragraph'); | ||
}, | ||
@@ -30,0 +30,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import { Node } from '@tiptap/core'; | ||
import { Node, mergeAttributes } from '@tiptap/core'; | ||
@@ -16,3 +16,3 @@ const Paragraph = Node.create({ | ||
renderHTML({ HTMLAttributes }) { | ||
return ['p', HTMLAttributes, 0]; | ||
return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]; | ||
}, | ||
@@ -25,3 +25,3 @@ addCommands() { | ||
setParagraph: () => ({ commands }) => { | ||
return commands.toggleBlockType('paragraph', 'paragraph'); | ||
return commands.toggleNode('paragraph', 'paragraph'); | ||
}, | ||
@@ -28,0 +28,0 @@ }; |
@@ -20,3 +20,3 @@ (function (global, factory) { | ||
renderHTML({ HTMLAttributes }) { | ||
return ['p', HTMLAttributes, 0]; | ||
return ['p', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]; | ||
}, | ||
@@ -29,3 +29,3 @@ addCommands() { | ||
setParagraph: () => ({ commands }) => { | ||
return commands.toggleBlockType('paragraph', 'paragraph'); | ||
return commands.toggleNode('paragraph', 'paragraph'); | ||
}, | ||
@@ -32,0 +32,0 @@ }; |
{ | ||
"name": "@tiptap/extension-paragraph", | ||
"version": "2.0.0-alpha.3", | ||
"description": "paragraph extension for tiptap", | ||
"version": "2.0.0-alpha.4", | ||
"homepage": "https://tiptap.dev", | ||
@@ -26,3 +27,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "7966af0fec4e65f83d7e5a22ccb9fc420a9a6728" | ||
"gitHead": "a884cb81de8783d0097741c1ddb97a82ea88ae0e" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Command, Node } from '@tiptap/core' | ||
import { Command, Node, mergeAttributes } from '@tiptap/core' | ||
@@ -27,3 +27,3 @@ export interface ParagraphOptions { | ||
renderHTML({ HTMLAttributes }) { | ||
return ['p', HTMLAttributes, 0] | ||
return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0] | ||
}, | ||
@@ -37,3 +37,3 @@ | ||
setParagraph: (): Command => ({ commands }) => { | ||
return commands.toggleBlockType('paragraph', 'paragraph') | ||
return commands.toggleNode('paragraph', 'paragraph') | ||
}, | ||
@@ -40,0 +40,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16809