[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Wed, 30 Nov 2022 07:10:38 -0500 (EST) |
branch: release/7.0
commit 7d7bfd91436db60dd3c171560ca7b464836d5405
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Nov 30 12:02:09 2022 +0000
update test result
---
.../formatting_epub_package/EPUB/js/info.css | 4 +++
.../formatting_epub_package/EPUB/js/info.js | 30 +++++++++++++++++++---
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.css
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.css
index 14537b67ad..28f7911ccf 100644
---
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.css
+++
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.css
@@ -226,6 +226,10 @@ table#keyboard-shortcuts th {
right: 0;
}
+.text-input input {
+ width: 25em;
+}
+
.error {
background-color: orange;
padding: 5px;
diff --git
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.js
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.js
index a43b1fd068..97c6ce3839 100644
---
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.js
+++
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.js
@@ -146,10 +146,32 @@
/** @arg {NodeListOf<Element>} links */
cache_index_links: function (links) {
var dict = {};
+ var text0 = "", text1 = ""; // for subentries
for (var i = 0; i < links.length; i += 1)
{
var link = links[i];
- dict[link.textContent] = href_hash (link_href (link));
+ var link_cl = link.classList;
+ var text = link.textContent;
+ if (link_cl.contains("index-entry-level-2"))
+ {
+ text = text0 + "; " + text1 + "; " + text;
+ }
+ else if (link_cl.contains("index-entry-level-1"))
+ {
+ text1 = text;
+ text = text0 + "; " + text;
+ }
+ else
+ {
+ text0 = text;
+ }
+
+ if ((link = link.nextSibling)
+ && link.classList.contains("printindex-index-section")
+ && (link = link.firstChild))
+ {
+ dict[text] = href_hash (link_href (link));
+ }
}
return { type: "cache-index-links", links: dict };
},
@@ -1457,9 +1479,9 @@
if (linkid_contains_index (linkid))
{
/* Scan links that should be added to the index. */
- var index_links = document.querySelectorAll
- ("td.printindex-index-entry a");
- store.dispatch (actions.cache_index_links (index_links));
+ var index_entries = document.querySelectorAll
+ ("td.printindex-index-entry");
+ store.dispatch (actions.cache_index_links (index_entries));
}
add_icons ();