From 4cab7d67c32683fce571ef281f2cbc211b3d7d3f Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Sun, 11 Feb 2018 21:17:38 +0200 Subject: [PATCH] Fix line break icon rendering in MS Edge --- .../components/Draftail/__snapshots__/index.test.js.snap | 1 + client/src/components/Draftail/index.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/components/Draftail/__snapshots__/index.test.js.snap b/client/src/components/Draftail/__snapshots__/index.test.js.snap index e72ea0194..f71176d76 100644 --- a/client/src/components/Draftail/__snapshots__/index.test.js.snap +++ b/client/src/components/Draftail/__snapshots__/index.test.js.snap @@ -12,6 +12,7 @@ Object { }, "enableLineBreak": Object { "description": "Line break", + "icon": "M.436 633.471l296.897-296.898v241.823h616.586V94.117h109.517v593.796H297.333v242.456z", }, "entityTypes": Array [ Object { diff --git a/client/src/components/Draftail/index.js b/client/src/components/Draftail/index.js index 3c5a461bf..f527a587c 100644 --- a/client/src/components/Draftail/index.js +++ b/client/src/components/Draftail/index.js @@ -13,6 +13,9 @@ export { default as EmbedBlock } from './blocks/EmbedBlock'; export { default as ModalWorkflowSource } from './sources/ModalWorkflowSource'; +// 1024x1024 SVG path rendering of the "↵" character, that renders badly in MS Edge. +const BR_ICON = 'M.436 633.471l296.897-296.898v241.823h616.586V94.117h109.517v593.796H297.333v242.456z'; + /** * Registry for client-side code of Draftail plugins. */ @@ -79,7 +82,10 @@ const initEditor = (fieldName, options) => { onSave={serialiseInputValue} placeholder={STRINGS.WRITE_HERE} spellCheck={true} - enableLineBreak={{ description: STRINGS.LINE_BREAK }} + enableLineBreak={{ + description: STRINGS.LINE_BREAK, + icon: BR_ICON, + }} showUndoControl={{ description: STRINGS.UNDO }} showRedoControl={{ description: STRINGS.REDO }} maxListNesting={4}