File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,15 @@ function escapeHtml(block: any): void {
281281 const rt = blockContent . rich_text [ i ] ;
282282
283283 // See https://github.com/sillsdev/docu-notion/issues/21.
284+ // For now, we just do a simple replace of < an > with < and >
285+ // but only if the text will not be displayed as code.
286+ // If it will be displayed as code,
287+ // a) nothing will be trying to parse it, so it is safe.
288+ // b) at no point does anything interpret the escaped character **back** to html;
289+ // so it will be displayed as "<" or ">".
290+ // We may have to add more complex logic here in the future if we
291+ // want to start letting html through which we **do** want to parse.
292+ // For example, we could assume that text in a valid html structure should be parsed.
284293 if (
285294 rt ?. plain_text &&
286295 block . type !== "code" &&
You can’t perform that action at this time.
0 commit comments