@tiptap/extension-text-align
Advanced tools
Comparing version
@@ -6,2 +6,10 @@ # Change Log | ||
# [2.0.0-beta.15](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-text-align@2.0.0-beta.14...@tiptap/extension-text-align@2.0.0-beta.15) (2021-05-11) | ||
**Note:** Version bump only for package @tiptap/extension-text-align | ||
# [2.0.0-beta.14](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-text-align@2.0.0-beta.13...@tiptap/extension-text-align@2.0.0-beta.14) (2021-05-07) | ||
@@ -8,0 +16,0 @@ |
@@ -21,8 +21,11 @@ 'use strict'; | ||
default: this.options.defaultAlignment, | ||
renderHTML: attributes => ({ | ||
style: `text-align: ${attributes.textAlign}`, | ||
}), | ||
parseHTML: element => ({ | ||
textAlign: element.style.textAlign || this.options.defaultAlignment, | ||
}), | ||
renderHTML: attributes => { | ||
if (attributes.textAlign === this.options.defaultAlignment) { | ||
return {}; | ||
} | ||
return { style: `text-align: ${attributes.textAlign}` }; | ||
}, | ||
}, | ||
@@ -29,0 +32,0 @@ }, |
@@ -17,8 +17,11 @@ import { Extension } from '@tiptap/core'; | ||
default: this.options.defaultAlignment, | ||
renderHTML: attributes => ({ | ||
style: `text-align: ${attributes.textAlign}`, | ||
}), | ||
parseHTML: element => ({ | ||
textAlign: element.style.textAlign || this.options.defaultAlignment, | ||
}), | ||
renderHTML: attributes => { | ||
if (attributes.textAlign === this.options.defaultAlignment) { | ||
return {}; | ||
} | ||
return { style: `text-align: ${attributes.textAlign}` }; | ||
}, | ||
}, | ||
@@ -25,0 +28,0 @@ }, |
@@ -21,8 +21,11 @@ (function (global, factory) { | ||
default: this.options.defaultAlignment, | ||
renderHTML: attributes => ({ | ||
style: `text-align: ${attributes.textAlign}`, | ||
}), | ||
parseHTML: element => ({ | ||
textAlign: element.style.textAlign || this.options.defaultAlignment, | ||
}), | ||
renderHTML: attributes => { | ||
if (attributes.textAlign === this.options.defaultAlignment) { | ||
return {}; | ||
} | ||
return { style: `text-align: ${attributes.textAlign}` }; | ||
}, | ||
}, | ||
@@ -29,0 +32,0 @@ }, |
{ | ||
"name": "@tiptap/extension-text-align", | ||
"description": "text align extension for tiptap", | ||
"version": "2.0.0-beta.14", | ||
"version": "2.0.0-beta.15", | ||
"homepage": "https://tiptap.dev", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "7ddc5d70765e7b036de5657222aef05e6c8759f7" | ||
"gitHead": "33cd806a8673b67f0bc5b1ba5b921b1027ba17dd" | ||
} |
@@ -40,8 +40,12 @@ import { Command, Extension } from '@tiptap/core' | ||
default: this.options.defaultAlignment, | ||
renderHTML: attributes => ({ | ||
style: `text-align: ${attributes.textAlign}`, | ||
}), | ||
parseHTML: element => ({ | ||
textAlign: element.style.textAlign || this.options.defaultAlignment, | ||
}), | ||
renderHTML: attributes => { | ||
if (attributes.textAlign === this.options.defaultAlignment) { | ||
return {} | ||
} | ||
return { style: `text-align: ${attributes.textAlign}` } | ||
}, | ||
}, | ||
@@ -48,0 +52,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
31830
5.27%268
4.69%