Beispiel #1
0
 def test_nested_quotes(self):
     expected_output = self.load_md("nested_quote2")
     quotebox = md.MarkdownQuotebox()
     quotebox.add(md.MarkdownParagraph("Paragraph 1"))
     nested_quotebox = md.MarkdownQuotebox()
     nested_quotebox.add(md.MarkdownParagraph("Paragraph 2 (nested)"))
     quotebox.add(nested_quotebox)
     quotebox.add(md.MarkdownParagraph("Paragraph 3"))
     self.assertEqual(expected_output, str(quotebox))
     expected_output = self.load_md("nested_quote3")
     level_0 = md.MarkdownDocument()
     level_1 = md.MarkdownQuotebox()
     level_2 = md.MarkdownQuotebox()
     level_3 = md.MarkdownQuotebox()
     level_0.add(md.MarkdownParagraph("Outside quotes!"))
     level_1.add(md.MarkdownParagraph("First level"))
     level_2.add(md.MarkdownParagraph("Second level"))
     level_3.add(md.MarkdownParagraph("Third level"))
     level_0.add(level_1)
     level_1.add(level_2)
     level_2.add(level_3)
     level_1.add(md.MarkdownParagraph("Back on the first level"))
     level_0.add(
         md.MarkdownLink("Link at the end of the document",
                         "https://nowhere.com"))
     self.assertEqual(expected_output, str(level_0))
Beispiel #2
0
 def test_quoted_list(self):
     expected_output = self.load_md("quoted_list")
     quote = md.MarkdownQuotebox()
     quote.add(md.MarkdownListItem("Item 1"))
     quote.add(md.MarkdownListItem("Item 2"))
     quote.add(md.MarkdownListItem("Item 3"))
     self.assertEqual(expected_output, str(quote))
Beispiel #3
0
 def test_basic_quote(self):
     expected_output = self.load_md("basic_quote")
     quotebox = md.MarkdownQuotebox()
     quotebox.add(md.MarkdownParagraph("The text of paragraph 1"))
     para = md.MarkdownParagraph()
     para.add("Some text before ")
     para.add(md.MarkdownStrong("the strong text"))
     quotebox.add(para)
     self.assertEqual(expected_output, str(quotebox))
Beispiel #4
0
 def test_quoted_code_fence(self):
     expected_output = self.load_md("quoted_code_fence")
     qcf = md.MarkdownDocument()
     qcf.add(md.MarkdownParagraph("Outside quotes!"))
     quote = md.MarkdownQuotebox()
     code = md.MarkdownCodeBlock("int x = 5\nx++\n")
     quote.add(code)
     quote.add(md.MarkdownParagraph("Below the code fence"))
     qcf.add(quote)
     self.assertEqual(expected_output, str(qcf))
Beispiel #5
0
def quote_boxify(content):
    quotebox = md.MarkdownQuotebox()
    quotebox.add(content)
    return str(quotebox)
Beispiel #6
0
def process_quote_box(quotebox, content):
    md_quote = md.MarkdownQuotebox()
    md_quote.add(content)
    return md_quote