diff --git a/src/util/html.js b/src/util/html.js index 89e52c7..d02e09d 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -50,7 +50,10 @@ function whenYouWalking(tree, images = true, embed = true) { for (const elem of tree) { if (elem["#text"]) { - str += elem["#text"].replaceAll(/[\\*\-_~#<[]/g, "\\$&").replaceAll("||", "|\u200b|"); + str += elem["#text"] + .toString() + .replaceAll(/[\\*\-_~#<[]/g, "\\$&") + .replaceAll("||", "|\u200b|"); } else if (elem.a) { const content = whenYouWalking(elem.a, images, embed); const link = elem.$href ?? elem[":@"]?.$href;