def footnote_reference_is_converted_to_superscript_intra_page_link():
    footnote_reference = documents.note_reference("footnote", "4")
    result = convert_document_element_to_html(
        footnote_reference,
        id_prefix="doc-42-"
    )
    assert_equal('<sup><a href="#doc-42-footnote-4" id="doc-42-footnote-ref-4">[1]</a></sup>', result.value)
Exemplo n.º 2
0
def footnote_reference_is_converted_to_superscript_intra_page_link():
    footnote_reference = documents.note_reference("footnote", "4")
    result = convert_document_element_to_html(footnote_reference,
                                              id_prefix="doc-42-")
    assert_equal(
        '<sup><a href="#doc-42-footnote-4" id="doc-42-footnote-ref-4">[1]</a></sup>',
        result.value)
Exemplo n.º 3
0
def footnotes_are_included_after_the_main_body():
    footnote_reference = documents.note_reference("footnote", "4")
    document = documents.document(
        [documents.paragraph([_run_with_text("Knock knock"), documents.run([footnote_reference])])],
        notes=documents.notes([documents.note("footnote", "4", [_paragraph_with_text("Who's there?")])]),
    )
    result = convert_document_element_to_html(document, id_prefix="doc-42")
    expected_html = (
        '<p>Knock knock<sup><a href="#doc-42-footnote-4" id="doc-42-footnote-ref-4">[1]</a></sup></p>'
        + '<ol><li id="doc-42-footnote-4"><p>Who\'s there? <a href="#doc-42-footnote-ref-4">↑</a></p></li></ol>'
    )
    assert_equal(expected_html, result.value)
def footnotes_are_included_after_the_main_body():
    footnote_reference = documents.note_reference("footnote", "4")
    document = documents.document(
        [documents.paragraph([
            _run_with_text("Knock knock"),
            documents.run([footnote_reference])
        ])],
        notes=documents.notes([
            documents.note("footnote", "4", [_paragraph_with_text("Who's there?")])
        ])
    )
    result = convert_document_element_to_html(
        document,
        id_prefix="doc-42"
    )
    expected_html = ('<p>Knock knock<sup><a href="#doc-42-footnote-4" id="doc-42-footnote-ref-4">[1]</a></sup></p>' +
                '<ol><li id="doc-42-footnote-4"><p>Who\'s there? <a href="#doc-42-footnote-ref-4">↑</a></p></li></ol>')
    assert_equal(expected_html, result.value)