1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

only decode the url when the content of the link is a string

This commit is contained in:
Maurits Lourens
2017-10-30 21:43:13 +01:00
parent f9643c2503
commit 44ece2bf34

View File

@@ -185,11 +185,13 @@ export default class MarkdownPreview extends React.Component {
}
fixDecodedURI (node) {
const { innerText, href } = node
if (node && node.children.length === 1 && typeof node.children[0] === 'string') {
const { innerText, href } = node
node.innerText = mdurl.decode(href) === innerText
? href
: innerText
node.innerText = mdurl.decode(href) === innerText
? href
: innerText
}
}
componentDidMount () {