Skip to content

Commit

Permalink
Merge branch 'issue-12'
Browse files Browse the repository at this point in the history
This merge adds horizontal rule support.
  • Loading branch information
NeilAn99 committed Sep 29, 2022
2 parents f277bc4 + ea7222a commit 88cd134
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
25 changes: 23 additions & 2 deletions generateHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ function readMdFile(input)
}
}

//check if the line is a horizontal rule
if (modifiedLine == "---")
{
modifiedLine = '<hr>';
}

lineArray.push(modifiedLine);
}
else
Expand Down Expand Up @@ -190,11 +196,26 @@ function writeFile(input, result, lang)
//try to format the HTML file better
if (lineNumber == 0)
{
content += "<p>" + theLine + "</p>\n";
//check if the line is an hr tag
if (theLine == "<hr>")
{
content += theLine + "\n";
}
else
{
content += "<p>" + theLine + "</p>\n";
}
}
else
{
content += "\t<p>" + theLine + "</p>\n";
if (theLine == "<hr>")
{
content += "\t" + theLine + "\n";
}
else
{
content += "\t<p>" + theLine + "</p>\n";
}
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion markdownTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ this line has no bolded text
this line has **bolded** text.

this **line** has **alternating** bolded **text**.

---
**this entire line should be bolded**.

0 comments on commit 88cd134

Please sign in to comment.