render newlines in story descriptions

master
Drake 1 year ago
parent c3de10b8bb
commit 1a565d7901

@ -38,8 +38,8 @@ export default () => {
const titleEle = document.createElement("h3");
titleEle.textContent = story.name;
div.appendChild(titleEle);
const descEle = document.createElement("o");
descEle.textContent = story.storyJSON.description;
const descEle = document.createElement("p");
descEle.innerHTML = story.storyJSON.description;
div.appendChild(descEle);
searchEle.appendChild(coverEle);
searchEle.appendChild(div);

@ -39,6 +39,11 @@ export default {
timestamp: new Date(),
};
await cache[id].story.init();
cache[id].story.storyJSON.description = cache[id].story.storyJSON
.description.replace(
"\n",
"<br>",
);
if (initChapters) {
for (let i = 0; i < cache[id].story.chapters.length; i++) {
await cache[id].story.chapters[i].init();

Loading…
Cancel
Save