Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswilburn committed Nov 29, 2023
1 parent a1c20de commit c4c60e1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions paraphrase/htmlToMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function recurse(node, settings = { listDepth: 0, bullet: "* " }) {
case "H4":
case "H5":
var level = node.tagName.match(/\d+/) * 1;
converted += `${"".padStart(level, "#")} ${recurse(node, settings)}\n\n`;
converted += `${"#".repeat(level)} ${recurse(node, settings)}\n\n`;
break;

case "P":
Expand Down Expand Up @@ -63,9 +63,6 @@ function recurse(node, settings = { listDepth: 0, bullet: "* " }) {
if (node.style.fontWeight * 1 > 400) {
nodeStack.push(document.createElement("b"));
}
if (node.style.textDecoration == "underline") {
nodeStack.push(document.createElement("u"));
}
var span = document.createElement("span");
var tail = nodeStack.reduce((acc, n) => acc.append(n) || n, span);
for (var child of node.childNodes) {
Expand Down

0 comments on commit c4c60e1

Please sign in to comment.