From 3d4b49fbba185624db052ad2685a55372ed321bd Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 27 Nov 2017 02:37:20 +0100 Subject: [PATCH] Remove redundant text-align: left --- lib/convert.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/convert.js b/lib/convert.js index 2516e40..c82a6b5 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -65,7 +65,7 @@ function getBodyXML(chapter, contentEl) { contentEl.removeChild(contentEl.lastElementChild); } - // Remove redundant attributes + // Remove redundant attributes and style Array.prototype.forEach.call(contentEl.children, child => { if (child.getAttribute("dir") === "ltr") { child.removeAttribute("dir"); @@ -78,6 +78,9 @@ function getBodyXML(chapter, contentEl) { if (child.getAttribute("style") === "text-align:left;") { child.removeAttribute("style"); } + if (child.getAttribute("style") === "text-align:left;padding-left:30px;") { + child.setAttribute("style", "padding-left:30px;"); + } }); // Remove empty s and s