Fix page display issue on list of tables/figures

This commit is contained in:
Hendrik Kleinwaechter
2023-08-18 17:28:13 +02:00
parent d02124bcfb
commit 76cec8c7bb

View File

@@ -59,6 +59,7 @@ class ModifyBuild
text = fix_js_dependency_link(text)
text = fix_list_of_tables_figures_duplicates(text)
text = fix_menus_list_figures_tables(text) if is_list_figures_tables?(text)
text = fix_list_of_figures_tables_display(text) if is_list_figures_tables?(text)
File.open(filename, "w") {|file| file.puts text }
end
@@ -532,6 +533,14 @@ class ModifyBuild
doc.to_html
end
# For some reason the links are not properly displayed and have odd color.
# This repairs the html and css.
def fix_list_of_figures_tables_display(text)
doc = build_doc(text)
content = doc.css(".main-content .TOC").remove_class("TOC")
doc.to_html
end
# For some reason the depdency is missing a // in the url.
def fix_js_dependency_link(text)
text.gsub("https:/cdn.jsdelivr.net", "https://cdn.jsdelivr.net")