added escape for `'`

master
Michael Ochmann 2 years ago
parent ef8a1b0c0d
commit 96bb12b411
  1. 38
      src/ui/src/components/SlideItem.js

@ -9,7 +9,8 @@ const EscapeSequences = {
""" : '"', """ : '"',
"&lt;" : "<", "&lt;" : "<",
"&gt;" : ">", "&gt;" : ">",
"&amp;" : "&" "&amp;" : "&",
"&#39;" : "'"
}; };
const EscapeSequencesRegex = new RegExp(Object.keys(EscapeSequences).join('|'), "g"); const EscapeSequencesRegex = new RegExp(Object.keys(EscapeSequences).join('|'), "g");
@ -27,9 +28,6 @@ const SlideItem = ({item}) => {
}; };
const content = useMemo(() => { const content = useMemo(() => {
if (item.type === "paragraph")
console.log(item.type, item);
switch (item.type) { switch (item.type) {
case "heading": case "heading":
const level = item.level || item.depth; const level = item.level || item.depth;
@ -94,6 +92,8 @@ const SlideItem = ({item}) => {
case '"': case '"':
case "&quot;": case "&quot;":
return '"'; return '"';
case "&#39;":
return "'";
default: default:
return ""; return "";
} }
@ -110,33 +110,3 @@ const SlideItem = ({item}) => {
}; };
export default SlideItem; 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"
}
]
} */
Loading…
Cancel
Save