Set default path for images

This commit is contained in:
Tuan Cao 2022-04-28 17:17:44 +07:00
parent c8ab797a15
commit fdf0e419bb

View File

@ -49,15 +49,12 @@ function convertTextNode(node) {
const imageNode = { const imageNode = {
type: "image", type: "image",
//TODO: Use some kind of option to pass in default images path //TODO: Use some kind of option to pass in default images path
url: encodeURI(match[1]), //encode white space from file name url: encodeURI(`/images/${match[1]}`), //encode white space from file name
alt: match[1], alt: match[1],
}; };
children.push(imageNode); children.push(imageNode);
if (typeof match[0] !== "string") {
console.log("THE FUCK again")
}
let matchEndIndex = match.index + match[0].length; let matchEndIndex = match.index + match[0].length;
startIndex = matchEndIndex; startIndex = matchEndIndex;
} }