Fixed a lot of bug when parsing .vmd files
This commit is contained in:
@@ -37,12 +37,12 @@
|
||||
if (!data.Content[ev.target.value]) return;
|
||||
fileoutput.innerHTML = [
|
||||
`<h1>${data.Content[ev.target.value].Title}</h1>`,
|
||||
...Object.keys(data.Content[ev.target.value].INFO).map(type => {
|
||||
...data.Content[ev.target.value].INFO ?
|
||||
Object.keys(data.Content[ev.target.value].INFO).map(type => {
|
||||
const content = data.Content[ev.target.value].INFO[type].split(/\r?\n/, 2);
|
||||
|
||||
if (content[1] == "") return `<p>${content.shift()}</p>`;
|
||||
if (content.length === 1) return `<p>${content.shift()}</p>`;
|
||||
return `<h2>${content.shift().replace("## ", "")}</h2><p>${content.shift()}</p>`;
|
||||
}),
|
||||
}) : [],
|
||||
].join("");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user