Remove redundant text-align: left

This commit is contained in:
Domenic Denicola 2017-11-27 02:37:20 +01:00
commit 3d4b49fbba

View file

@ -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 <em>s and <i>s