Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "ririio-ssg", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -10,3 +10,3 @@ const fs = require('fs') | ||
// Used to check if the 2nd and 3rd index contains a value to determine whether the first line is a title | ||
if (!lines[1].trim().length && !lines[2].trim()) { | ||
if (!lines[1]?.trim().length && !lines[2]?.trim()) { | ||
;[storyTitle] = lines | ||
@@ -28,8 +28,8 @@ lines[0] = `<h1>${lines[0]}</h1>` | ||
for (i; i < lines.length; ++i) { | ||
if (lines[i].trim().length) { | ||
if (lines[i]?.trim().length) { | ||
lines[i] = `<p>${lines[i]}` | ||
// Keep looping until the value of the line after the current one is empty | ||
while (lines[i].trim().length) { | ||
if (lines[i + 1].trim().length === 0) { | ||
while (lines[i]?.trim().length) { | ||
if (lines[i + 1]?.trim().length === 0) { | ||
lines[i] = `${lines[i]}</p>` | ||
@@ -36,0 +36,0 @@ } |
364137