Commit 0ec2ef6a authored by Marco Cavalli's avatar Marco Cavalli
Browse files

feat: add tabs in level 5 and 6 headings

parent 69fa5d53
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -660,9 +660,9 @@ def add_whitespace_placeholder_to_headings(soup: BeautifulSoup):
    HEADER_TAGS = ["h1", "h2", "h3", "h4", "h5", "h6"]
    headers = soup.find_all(HEADER_TAGS)

    main_headers = r"\d+(?:\.\d+){0,2}"
    main_headers = r"\d+(?:\.\d+){0,5}"
    annex_headers = r"Annex\s[A-Z](?:\s(?:\(normative\)|\(informative\)))?:"
    annex_subheaders = r"[A-Z](?:\.\d{1,2})+"
    annex_subheaders = r"[A-Z](?:\.\d{1,5})+"

    tabbed_header_regex = rf"^({main_headers}|{annex_subheaders})\s"  # The headers that should have a tab offset
    newline_header_regex = rf"^({annex_headers})\s*"