From 064d5051b5834bba62ac21859a8a22d9b72a4a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Mon, 18 Mar 2019 08:28:48 +0100 Subject: [PATCH] Raw handling: update strikethrough (#14430) --- .../blocks/src/api/raw-handling/phrasing-content-reducer.js | 2 +- packages/blocks/src/api/raw-handling/phrasing-content.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/blocks/src/api/raw-handling/phrasing-content-reducer.js b/packages/blocks/src/api/raw-handling/phrasing-content-reducer.js index defdbe1eb97dc..5c5ef223298fe 100644 --- a/packages/blocks/src/api/raw-handling/phrasing-content-reducer.js +++ b/packages/blocks/src/api/raw-handling/phrasing-content-reducer.js @@ -23,7 +23,7 @@ export default function( node, doc ) { } if ( textDecorationLine === 'line-through' ) { - wrap( doc.createElement( 'del' ), node ); + wrap( doc.createElement( 's' ), node ); } if ( verticalAlign === 'super' ) { diff --git a/packages/blocks/src/api/raw-handling/phrasing-content.js b/packages/blocks/src/api/raw-handling/phrasing-content.js index c39b3330f1105..028c61e9b8958 100644 --- a/packages/blocks/src/api/raw-handling/phrasing-content.js +++ b/packages/blocks/src/api/raw-handling/phrasing-content.js @@ -6,6 +6,7 @@ import { omit } from 'lodash'; const phrasingContentSchema = { strong: {}, em: {}, + s: {}, del: {}, ins: {}, a: { attributes: [ 'href', 'target', 'rel' ] }, @@ -20,7 +21,7 @@ const phrasingContentSchema = { // Recursion is needed. // Possible: strong > em > strong. // Impossible: strong > strong. -[ 'strong', 'em', 'del', 'ins', 'a', 'code', 'abbr', 'sub', 'sup' ].forEach( ( tag ) => { +[ 'strong', 'em', 's', 'del', 'ins', 'a', 'code', 'abbr', 'sub', 'sup' ].forEach( ( tag ) => { phrasingContentSchema[ tag ].children = omit( phrasingContentSchema, tag ); } );