diff --git a/lib/convert-worker.js b/lib/convert-worker.js index 8d3b2e4..c29163c 100644 --- a/lib/convert-worker.js +++ b/lib/convert-worker.js @@ -57,11 +57,16 @@ function getBodyXML(chapter, book, contentEl) { // useless) child.removeAttribute("align"); - if (child.getAttribute("style") === "text-align:left;") { + const style = child.getAttribute("style"); + if (style === "text-align:left;" || style === "text-align: left;") { child.removeAttribute("style"); } - if (child.getAttribute("style") === "text-align:left;padding-left:30px;") { - child.setAttribute("style", "padding-left:30px;"); + + // Worm uses 30px; Ward mostly uses 40px but sometimes uses 30px/60px. Let's standardize on 30px. + if (style === "text-align:left;padding-left:30px;" || + style === "text-align: left;padding-left: 40px;" || + style === "padding-left: 40px;") { + child.setAttribute("style", "padding-left: 30px;"); } }