Skip to content

Commit

Permalink
Updated table and table cell properties upcast.
Browse files Browse the repository at this point in the history
  • Loading branch information
niegowski committed May 5, 2021
1 parent 7157ac6 commit 7df8528
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ function enableHorizontalAlignmentProperty( schema, conversion, defaultValue ) {
// Support for the `text-align:*;` CSS definition for the table cell alignment.
.attributeToAttribute( {
view: {
name: /^(td|th)$/,
styles: {
'text-align': ALIGN_VALUES_REG_EXP
}
},
model: {
name: 'tableCell',
key: 'horizontalAlignment',
value: viewElement => {
const align = viewElement.getStyle( 'text-align' );
Expand All @@ -205,12 +205,12 @@ function enableHorizontalAlignmentProperty( schema, conversion, defaultValue ) {
// Support for the `align` attribute as the backward compatibility while pasting from other sources.
.attributeToAttribute( {
view: {
name: /^(td|th)$/,
attributes: {
align: ALIGN_VALUES_REG_EXP
}
},
model: {
name: 'tableCell',
key: 'horizontalAlignment',
value: viewElement => {
const align = viewElement.getAttribute( 'align' );
Expand Down Expand Up @@ -249,12 +249,12 @@ function enableVerticalAlignmentProperty( schema, conversion, defaultValue ) {
// Support for the `vertical-align:*;` CSS definition for the table cell alignment.
.attributeToAttribute( {
view: {
name: /^(td|th)$/,
styles: {
'vertical-align': VALIGN_VALUES_REG_EXP
}
},
model: {
name: 'tableCell',
key: 'verticalAlignment',
value: viewElement => {
const align = viewElement.getStyle( 'vertical-align' );
Expand All @@ -266,12 +266,12 @@ function enableVerticalAlignmentProperty( schema, conversion, defaultValue ) {
// Support for the `align` attribute as the backward compatibility while pasting from other sources.
.attributeToAttribute( {
view: {
name: /^(td|th)$/,
attributes: {
valign: VALIGN_VALUES_REG_EXP
}
},
model: {
name: 'tableCell',
key: 'verticalAlignment',
value: viewElement => {
const valign = viewElement.getAttribute( 'valign' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ function enableAlignmentProperty( schema, conversion, defaultValue ) {
// Support for the `float:*;` CSS definition for the table alignment.
.attributeToAttribute( {
view: {
name: /^(table|figure)$/,
styles: {
float: FLOAT_VALUES_REG_EXP
}
},
model: {
name: 'table',
key: 'alignment',
value: viewElement => {
let align = viewElement.getStyle( 'float' );
Expand Down

0 comments on commit 7df8528

Please sign in to comment.