From 96bb12b411535c1a1d289bf4ddc64f8303a95d81 Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Wed, 25 Oct 2023 13:40:51 +0200 Subject: [PATCH] added escape for `'` --- src/ui/src/components/SlideItem.js | 40 ++++-------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/src/ui/src/components/SlideItem.js b/src/ui/src/components/SlideItem.js index 09aff69..d0c1eab 100644 --- a/src/ui/src/components/SlideItem.js +++ b/src/ui/src/components/SlideItem.js @@ -9,7 +9,8 @@ const EscapeSequences = { """ : '"', "<" : "<", ">" : ">", - "&" : "&" + "&" : "&", + "'" : "'" }; const EscapeSequencesRegex = new RegExp(Object.keys(EscapeSequences).join('|'), "g"); @@ -27,9 +28,6 @@ const SlideItem = ({item}) => { }; const content = useMemo(() => { - - if (item.type === "paragraph") - console.log(item.type, item); switch (item.type) { case "heading": const level = item.level || item.depth; @@ -94,6 +92,8 @@ const SlideItem = ({item}) => { case '"': case """: return '"'; + case "'": + return "'"; default: return ""; } @@ -109,34 +109,4 @@ const SlideItem = ({item}) => { ); }; -export default SlideItem; - -/* { - "type": "paragraph", - "raw": "This is a very fancy **bold** keynote", - "text": "This is a very fancy **bold** keynote", - "tokens": [ - { - "type": "text", - "raw": "This is a very fancy ", - "text": "This is a very fancy " - }, - { - "type": "strong", - "raw": "**bold**", - "text": "bold", - "tokens": [ - { - "type": "text", - "raw": "bold", - "text": "bold" - } - ] - }, - { - "type": "text", - "raw": " keynote", - "text": " keynote" - } - ] -} */ \ No newline at end of file +export default SlideItem; \ No newline at end of file