1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +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,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 () {