[evolution/wip/mcrha/webkit-jsc-api] e-conver.js: Count only LI nodes in OL lists (could be broken by nested lists)
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/mcrha/webkit-jsc-api] e-conver.js: Count only LI nodes in OL lists (could be broken by nested lists)
- Date: Wed, 20 Nov 2019 17:16:34 +0000 (UTC)
commit 3a1121c210b3c4c833b0bbcc89e1cb486acaa1d7
Author: Milan Crha <mcrha redhat com>
Date: Wed Nov 20 18:17:06 2019 +0100
e-conver.js: Count only LI nodes in OL lists (could be broken by nested lists)
data/webkit/e-convert.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/data/webkit/e-convert.js b/data/webkit/e-convert.js
index 7ddcdee99f..ec21881455 100644
--- a/data/webkit/e-convert.js
+++ b/data/webkit/e-convert.js
@@ -189,8 +189,15 @@ EvoConvert.replaceList = function(element, tagName)
if (!type)
type = "";
+ var nChildren = 0, child;
+ for (ii = 0; ii < list.children.length; ii++) {
+ child = list.children.item(ii);
+ if (child.tagName == "LI")
+ nChildren++;
+ }
+
prefixSuffix = ltr ? ". " : " .";
- indent = EvoConvert.GetOLMaxLetters(type, list.children.length) + prefixSuffix.length;
+ indent = EvoConvert.GetOLMaxLetters(type, nChildren) + prefixSuffix.length;
if (indent < EvoConvert.MIN_OL_WIDTH)
indent = EvoConvert.MIN_OL_WIDTH;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]