Skip to content

Commit

Permalink
static ToC link to h1/anchor, not h1: metanorma/metanorma-ogc#659
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed May 1, 2024
1 parent eb7265b commit b0b2f0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/isodoc/html_function/postprocess.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def html5(doc)

def html_cleanup(html)
html = term_header(html_footnote_filter(html_preface(htmlstyle(html))))
html = footnote_format(footnote_backlinks(html_toc(html)))
html = footnote_format(footnote_backlinks(html))
html = mathml(html_list_clean(remove_placeholder_paras(html)))
heading_anchors(sourcecode_cleanup(html))
html_toc(heading_anchors(sourcecode_cleanup(html)))
end

def heading_anchors(html)
Expand Down
4 changes: 3 additions & 1 deletion lib/isodoc/html_function/postprocess_cover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def html_intro(docxml)
def html_toc_entry(level, header)
content = header.at("./following-sibling::p" \
"[@class = 'variant-title-toc']") || header
%(<li class="#{level}"><a href="##{header['id']}">\
id = header.at(".//a[@class = 'anchor']/@href")&.text&.sub(/^#/, "") |
header["id"]
%(<li class="#{level}"><a href="##{id}">\
#{header_strip(content)}</a></li>)
end

Expand Down

0 comments on commit b0b2f0e

Please sign in to comment.