Ejemplo n.º 1
0
def test_blockquote_two_paragraphs():
    resp = rydown.to_mediawiki("""> This is a blockquote with two paragraphs.
> Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.\n\n""")
    assert resp == """<blockquote><p> This is a blockquote with two paragraphs.
Ejemplo n.º 2
0
def test_not_numberedlist():
    resp = rydown.to_mediawiki("1986\. What a great season.\n")
    assert resp == "<p>1986. What a great season.</p>\n"
Ejemplo n.º 3
0
def test_numberedlist():
    resp = rydown.to_mediawiki("1. apples\n2. oranges\n3. pears\n\n")
    assert resp == """<ol>
Ejemplo n.º 4
0
def test_bulletlist_plus():
    resp = rydown.to_mediawiki("+ apples\n+ oranges\n+ pears\n\n")
    assert resp == "*apples\n*oranges\n*pears\n"
Ejemplo n.º 5
0
def test_textattributes():
    resp = rydown.to_mediawiki(
        "Text attributes _italic_, **bold**, `monospace`.\n")
    assert resp == "<p>Text attributes _italic_, '''bold''',"\
        " <code>monospace</code>.</p>\n"
Ejemplo n.º 6
0
def test_textitalicbold_asterisc():
    resp = rydown.to_mediawiki("***italic bold***\n")
    assert resp == "<p>'''''italic bold'''''</p>\n" or resp == "<p>''''' italic bold '''''</p>\n"
Ejemplo n.º 7
0
def test_paragraph():
    resp = rydown.to_mediawiki("Paragraphs are separated\nby a blank line.\n")
    assert resp == "<p>Paragraphs are separated\nby a blank line.</p>\n"
Ejemplo n.º 8
0
def test_heading_h2():
    """Header level 2"""
    resp = rydown.to_mediawiki("## Heading 2\n")
    assert resp == "== Heading 2 ==\n"
Ejemplo n.º 9
0
def test_link_ref():
    resp = rydown.to_mediawiki(
        """[an example][id]\n\n[id]: http://example.com/\n""")
    assert resp == "<p>[http://example.com/#id an example]</p>\n"
Ejemplo n.º 10
0
def test_heading_h1_underline():
    """Underline header level 1"""
    resp = rydown.to_mediawiki("Heading 1\n=========\n")
    assert resp == "= Heading 1 =\n"
Ejemplo n.º 11
0
def test_link():
    resp = rydown.to_mediawiki("A [link](https://www.example.com).\n")
    assert resp == "<p>A [https://www.example.com link].</p>\n"
Ejemplo n.º 12
0
def test_comment_startline():
    resp = rydown.to_mediawiki(
        "<-- Comment -->Comment in the beginning of line\n")
    assert resp == "<p>Comment in the beginning of line</p>\n"
Ejemplo n.º 13
0
def test_comment_simple():
    resp = rydown.to_mediawiki("<-- Comment -->")
    assert resp == ""
Ejemplo n.º 14
0
def test_numberedlist_mixnumering():
    resp = rydown.to_mediawiki("2. apples\n3. oranges\n1. pears\n\n")
    assert resp == """<ol>
Ejemplo n.º 15
0
def test_heading_h2_underline():
    """Underline header level 2"""
    resp = rydown.to_mediawiki("Heading 2\n---------\n")
    assert resp == "== Heading 2 ==\n"
Ejemplo n.º 16
0
def test_heading_h1():
    """Header level 1"""
    resp = rydown.to_mediawiki("# Heading 1\n")
    assert resp == "= Heading 1 =\n"
Ejemplo n.º 17
0
def test_image():
    resp = rydown.to_mediawiki("![Image](https://www.example.com/img.png)\n")
    assert resp == """<span class="plainlinks">[{{fullurl:Image}} https://www.example.com/img.png]</span>"""
Ejemplo n.º 18
0
def test_heading_h3_b():
    """Header level 3"""
    resp = rydown.to_mediawiki("### Heading 3 ###\n\n")
    assert resp == "=== Heading 3 ===\n"
Ejemplo n.º 19
0
def test_blockquote():
    resp = rydown.to_mediawiki(
        "> Markdown uses email-style > characters for blockquoting.\n\n")
    assert resp == "<blockquote><p> Markdown uses email-style &gt;" \
        " characters for blockquoting.</p></blockquote>\n"
Ejemplo n.º 20
0
def test_textitalic_asterisc():
    resp = rydown.to_mediawiki("*italic*\n")
    assert resp == "<p>'' italic ''</p>\n" or resp == "<p>''italic''</p>\n"
Ejemplo n.º 21
0
def test_inlinecode():
    resp = rydown.to_mediawiki("`This is a code block.`\n")
    assert resp == "<p><code>This is a code block.</code></p>\n"
Ejemplo n.º 22
0
def test_table():
    resp = rydown.to_mediawiki("a|b|c\n-|-|-\nd|e|f\n\n")
    assert resp == "\n{|\n!a\n!b\n!c\n|-\n|d\n|e\n|f\n|}\n"
Ejemplo n.º 23
0
def test_heading_h1_underline_singleline():
    resp = rydown.to_mediawiki("Heading 1\n=========\nOnly one newline\n")
    assert resp == "= Heading 1 =\n<p>Only one newline</p>\n"
Ejemplo n.º 24
0
def test_bulletlist_asterisc():
    resp = rydown.to_mediawiki("* apples\n* oranges\n* pears\n\n")
    assert resp == "*apples\n*oranges\n*pears\n"
Ejemplo n.º 25
0
def test_codeblock_lang():
    resp = rydown.to_mediawiki("""```bash
This is a code block.```\n""")
    assert resp == "<syntaxhighlight lang='bash'>This is a" \
        " code block.</syntaxhighlight>\n"
Ejemplo n.º 26
0
def test_bulletlist_minus():
    resp = rydown.to_mediawiki("- apples\n- oranges\n- pears\n\n")
    assert resp == "*apples\n*oranges\n*pears\n"
Ejemplo n.º 27
0
def test_bulletlist_asterisc_sublists_tabs():
    resp = rydown.to_mediawiki(
        "* apples\n\t* oranges\n\t\t* pears\n\t\t\t* bananas\n\t\t\t\t* tomatos\n\n"
    )
    assert resp == "*apples\n**oranges\n***pears\n****bananas\n*****tomatos\n"