Commit cfd1e5d3 authored by Marco Cavalli's avatar Marco Cavalli
Browse files

fix: prevent autonumbering procedure to add missing EXAMPLE text

parent 50d21bca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -537,12 +537,12 @@ def auto_number_content(

    ### We need to run again the logic where we add the number in examples and notes since we might not have done it for all cases (it triggers on specific points, and if it happens the element is in the last heading/table it may be skipped)

    if example_counter >= 1 and first_example_line_index != -1:
    if example_counter >= 1 and first_example_line_index != -1 and "EXAMPLE" not in lines[first_example_line_index]:
        lines[
            first_example_line_index
        ] += f" EXAMPLE{' 1' if example_counter > 1 else ''}:"

    if note_counter >= 1 and first_note_line_index != -1:
    if note_counter >= 1 and first_note_line_index != -1 and "NOTE" not in lines[first_note_line_index]:
        lines[first_note_line_index] += f" NOTE{' 1' if note_counter > 1 else ''}:"

    if note_in_table_counter >= 1 and first_note_in_table_line_index != -1: