1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-17 19:51:42 +00:00

Merge pull request #1042 from mslourens/image-in-anchor

only decode the url when the content of the link is a string
This commit is contained in:
Kazu Yokomizo
2017-10-31 13:23:54 +09:00
committed by GitHub

View File

@@ -185,12 +185,14 @@ export default class MarkdownPreview extends React.Component {
}
fixDecodedURI (node) {
if (node && node.children.length === 1 && typeof node.children[0] === 'string') {
const { innerText, href } = node
node.innerText = mdurl.decode(href) === innerText
? href
: innerText
}
}
componentDidMount () {
this.refs.root.setAttribute('sandbox', 'allow-scripts')