Exemple #1
0
def test_example_83():
    text = ("    foo\n"
            "bar\n")
    result = publish(text)
    assert_node(result, [nodes.document, ([nodes.literal_block, "foo\n"],
                                          [nodes.paragraph, "bar"])])
Exemple #2
0
def test_example_489():
    result = publish("[foo [bar](/uri)](/uri)")
    assert_node(result, [
        nodes.document, nodes.paragraph,
        ("[foo ", [nodes.reference, "bar"], "](/uri)")
    ])
Exemple #3
0
def test_example_492():
    result = publish("*[foo*](/uri)")
    assert_node(
        result,
        [nodes.document, nodes.paragraph, ("*", [nodes.reference, "foo*"])])
Exemple #4
0
def test_example_483():
    result = publish("[link [foo [bar]]](/uri)")
    assert_node(
        result,
        [nodes.document, nodes.paragraph, nodes.reference, "link [foo [bar]]"])
    assert_node(result[0][0], refuri="/uri")
Exemple #5
0
def test_example_486():
    result = publish("[link \\[bar](/uri)")
    assert_node(
        result,
        [nodes.document, nodes.paragraph, nodes.reference, "link [bar"])
Exemple #6
0
def test_example_478_2():
    result = publish(r"[link](<foo\>)")
    assert_node(result, [nodes.document, nodes.paragraph, "[link](<foo>)"])
Exemple #7
0
def test_example_480():
    result = publish("""[link](/url 'title "and" title')""")
    assert_node(result,
                [nodes.document, nodes.paragraph, nodes.reference, "link"])
    assert_node(result[0][0], refuri="/url", reftitle='title "and" title')
Exemple #8
0
def test_example_114_2():
    text = ("~~~ aa ``` ~~~\n"
            "foo\n"
            "~~~\n")
    result = publish(text)
    assert_node(result, [nodes.document, nodes.literal_block, "foo\n"])
Exemple #9
0
def test_example_115():
    text = ("```\n"
            "``` aaa\n"
            "```\n")
    result = publish(text)
    assert_node(result, [nodes.document, nodes.literal_block, "``` aaa\n"])
Exemple #10
0
def test_example_107():
    text = ("``` ```\n"
            "aaa\n")
    result = publish(text)
    assert_node(result, [nodes.document, nodes.paragraph, (nodes.literal,
                                                           "\naaa")])
Exemple #11
0
def test_example_114():
    text = ("``` aa ```\n"
            "foo\n")
    result = publish(text)
    assert_node(result, [nodes.document, nodes.paragraph, ([nodes.literal, "aa"],
                                                           "\nfoo")])
Exemple #12
0
def test_example_95():
    result = publish("```")
    assert_node(result, [nodes.document, nodes.literal_block])
Exemple #13
0
def test_example_90():
    text = ("``\n"
            "foo\n"
            "``\n")
    result = publish(text)
    assert_node(result, [nodes.document, nodes.paragraph, nodes.literal, "foo"])
Exemple #14
0
def test_example_7():
    result = publish("-\t\tfoo\n")
    assert_node(result, [nodes.document, nodes.bullet_list, nodes.list_item, nodes.literal_block, "  foo\n"])
Exemple #15
0
def test_example_477():
    result = publish("""[link](/url "title \\"&quot;")""")
    assert_node(result,
                [nodes.document, nodes.paragraph, nodes.reference, "link"])
    assert_node(result[0][0], refuri="/url", reftitle='title ""')
Exemple #16
0
def test_example_14():
    result = publish("+++")
    assert_node(result, [nodes.document, nodes.paragraph, "+++"])
Exemple #17
0
def test_example_478():
    result = publish("""[link](/url\xa0"title")""")
    assert_node(result,
                [nodes.document, nodes.paragraph, nodes.reference, "link"])
    assert_node(result[0][0], refuri='/url%C2%A0%22title%22')
Exemple #18
0
def test_example_16():
    text = ("--\n"
            "**\n"
            "__\n")
    result = publish(text)
    assert_node(result, [nodes.document, nodes.paragraph, "--\n**\n__"])
Exemple #19
0
def test_example_479():
    text = '[link](/url "title "and" title")'
    result = publish(text)
    assert_node(result, [nodes.document, nodes.paragraph, text])
Exemple #20
0
def test_example_172():
    result = publish("[foo]: /url")
    assert_node(result, [nodes.document, nodes.target])
Exemple #21
0
def test_example_481():
    text = ('[link](   /uri\n' '  "title"  )\n')
    result = publish(text)
    assert_node(result,
                [nodes.document, nodes.paragraph, nodes.reference, "link"])
    assert_node(result[0][0], refuri="/uri", reftitle="title")
Exemple #22
0
def test_example_174():
    result = publish('[foo]: /url "title" ok')
    assert_node(result, [nodes.document, nodes.paragraph, '[foo]: /url "title" ok'])
Exemple #23
0
def test_example_484():
    result = publish("[link] bar](/uri)")
    assert_node(result, [nodes.document, nodes.paragraph, "[link] bar](/uri)"])
Exemple #24
0
def test_example_175():
    text = ('[foo]: /url\n'
            '"title" ok\n')
    result = publish(text)
    assert_node(result, [nodes.document, (nodes.target,
                                          [nodes.paragraph, '"title" ok'])])
Exemple #25
0
def test_example_461():
    result = publish("[link]()")
    assert_node(result,
                [nodes.document, nodes.paragraph, nodes.reference, "link"])
    assert_node(result[0][0], refuri="")
Exemple #26
0
def test_example_473():
    result = publish("[link](foo\\bar)")
    assert_node(result,
                [nodes.document, nodes.paragraph, nodes.reference, "link"])
    assert_node(result[0][0], refuri="foo%5Cbar")
Exemple #27
0
def test_example_491():
    result = publish("![[[foo](uri1)](uri2)](uri3)")
    assert_node(result, [nodes.document, nodes.paragraph, nodes.image])
    assert_node(result[0][0], uri="uri3", alt="[foo](uri2)")
Exemple #28
0
def test_example_474_2():
    result = publish("[link](<foo%20b&auml;>)")
    assert_node(result,
                [nodes.document, nodes.paragraph, nodes.reference, "link"])
    assert_node(result[0][0], refuri="foo%20b%C3%A4")
Exemple #29
0
def test_example_493():
    result = publish("[foo *bar](baz*)")
    assert_node(result,
                [nodes.document, nodes.paragraph, nodes.reference, "foo *bar"])
    assert_node(result[0][0], refuri="baz*")
Exemple #30
0
def test_example_82():
    text = ("Foo\n"
            "    bar\n")
    result = publish(text)
    assert_node(result, [nodes.document, nodes.paragraph, "Foo\nbar"])