Compare commits
2 Commits
e8911dc1d1
...
02d165b2b2
| Author | SHA1 | Date | |
|---|---|---|---|
| 02d165b2b2 | |||
| 2d10abf9aa |
@@ -5,6 +5,7 @@ import localForage from 'localforage';
|
|||||||
import { sourceLink, infoLine, ToggleDot } from './utils.js';
|
import { sourceLink, infoLine, ToggleDot } from './utils.js';
|
||||||
|
|
||||||
const VOID_ELEMENTS = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
const VOID_ELEMENTS = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
||||||
|
const DANGEROUS_TAGS = ['svg', 'math'];
|
||||||
|
|
||||||
function Article({ cache }) {
|
function Article({ cache }) {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
@@ -106,6 +107,10 @@ function Article({ cache }) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DANGEROUS_TAGS.includes(v.localName)) {
|
||||||
|
return <span key={key} dangerouslySetInnerHTML={{ __html: v.outerHTML }} />;
|
||||||
|
}
|
||||||
|
|
||||||
const Tag = v.localName;
|
const Tag = v.localName;
|
||||||
if (isCodeBlock(v)) {
|
if (isCodeBlock(v)) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user