@tiptap/extension-text-align
Advanced tools
Comparing version 2.10.4 to 2.11.0
@@ -13,3 +13,3 @@ import { Extension } from '@tiptap/core'; | ||
alignments: ['left', 'center', 'right', 'justify'], | ||
defaultAlignment: 'left', | ||
defaultAlignment: null, | ||
}; | ||
@@ -25,7 +25,7 @@ }, | ||
parseHTML: element => { | ||
const alignment = element.style.textAlign || this.options.defaultAlignment; | ||
const alignment = element.style.textAlign; | ||
return this.options.alignments.includes(alignment) ? alignment : this.options.defaultAlignment; | ||
}, | ||
renderHTML: attributes => { | ||
if (attributes.textAlign === this.options.defaultAlignment) { | ||
if (!attributes.textAlign) { | ||
return {}; | ||
@@ -32,0 +32,0 @@ } |
@@ -17,3 +17,3 @@ (function (global, factory) { | ||
alignments: ['left', 'center', 'right', 'justify'], | ||
defaultAlignment: 'left', | ||
defaultAlignment: null, | ||
}; | ||
@@ -29,7 +29,7 @@ }, | ||
parseHTML: element => { | ||
const alignment = element.style.textAlign || this.options.defaultAlignment; | ||
const alignment = element.style.textAlign; | ||
return this.options.alignments.includes(alignment) ? alignment : this.options.defaultAlignment; | ||
}, | ||
renderHTML: attributes => { | ||
if (attributes.textAlign === this.options.defaultAlignment) { | ||
if (!attributes.textAlign) { | ||
return {}; | ||
@@ -36,0 +36,0 @@ } |
@@ -20,3 +20,3 @@ import { Extension } from '@tiptap/core'; | ||
*/ | ||
defaultAlignment: string; | ||
defaultAlignment: string | null; | ||
} | ||
@@ -23,0 +23,0 @@ declare module '@tiptap/core' { |
{ | ||
"name": "@tiptap/extension-text-align", | ||
"description": "text align extension for tiptap", | ||
"version": "2.10.4", | ||
"version": "2.11.0", | ||
"homepage": "https://tiptap.dev", | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@tiptap/core": "^2.10.4" | ||
"@tiptap/core": "^2.11.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "peerDependencies": { |
@@ -23,3 +23,3 @@ import { Extension } from '@tiptap/core' | ||
*/ | ||
defaultAlignment: string, | ||
defaultAlignment: string | null, | ||
} | ||
@@ -56,3 +56,3 @@ | ||
alignments: ['left', 'center', 'right', 'justify'], | ||
defaultAlignment: 'left', | ||
defaultAlignment: null, | ||
} | ||
@@ -69,3 +69,3 @@ }, | ||
parseHTML: element => { | ||
const alignment = element.style.textAlign || this.options.defaultAlignment | ||
const alignment = element.style.textAlign | ||
@@ -75,3 +75,3 @@ return this.options.alignments.includes(alignment) ? alignment : this.options.defaultAlignment | ||
renderHTML: attributes => { | ||
if (attributes.textAlign === this.options.defaultAlignment) { | ||
if (!attributes.textAlign) { | ||
return {} | ||
@@ -78,0 +78,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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29590