• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python markdown_adapter.run_markdown函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中markdown_adapter.run_markdown函数的典型用法代码示例。如果您正苦于以下问题:Python run_markdown函数的具体用法?Python run_markdown怎么用?Python run_markdown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了run_markdown函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_headers

 def test_headers(self):
     self.assertEqual(
             run_markdown('#h1 header'),'<h1>h1 header</h1>')
     self.assertEqual(
             run_markdown('##h2 header'),'<h2>h2 header</h2>')
     self.assertEqual(
             run_markdown('###h3 header'),'<h3>h3 header</h3>')
开发者ID:sadeslandes,项目名称:CSCI2963,代码行数:7,代码来源:test_markdown_unittest.py


示例2: test_blockquote

 def test_blockquote(self):
     self.assertEqual(
             run_markdown('>single line'),'<blockquote><p>single line</p></blockquote>')
     self.assertEqual(
             run_markdown('>blockquote\nNo blockquote\n>#header blockquote'),'<blockquote><p>blockquote</p></blockquote>\r\n<p>No blockquote</p>\r\n<blockquote><h1>header blockquote</h1></blockquote>')
     self.assertEqual(
             run_markdown('>multiline\n>blockquote'),'<blockquote><p>multiline</p>\r\n<p>blockquote</p></blockquote>')
     self.assertEqual(
             run_markdown('>multiline\n>blockquote\nWith a no blockquote line at the end'),'<blockquote><p>multiline</p>\r\n<p>blockquote</p></blockquote>\r\n<p>With a no blockquote line at the end</p>')        
开发者ID:sadeslandes,项目名称:CSCI2963,代码行数:9,代码来源:test_markdown_unittest.py


示例3: test_heading

    def test_heading(self):
	
	#Lines with '###', '##', or '#' should be wrapped with heading tags
	
	self.assertEqual(
                run_markdown('###this should be wrapped in h3 tags'),
                '<p><h3>this should be wrapped in h3 tags</h3></p>')

	self.assertEqual(
                run_markdown('##this should be wrapped in h2 tags'),
                '<p><h2>this should be wrapped in h2 tags</h2></p>')

	self.assertEqual(
                run_markdown('#this should be wrapped in h1 tags'),
                '<p><h1>this should be wrapped in h1 tags</h1></p>')
开发者ID:SeanWaclawik,项目名称:open_source,代码行数:15,代码来源:test_markdown_unittest.py


示例4: testHeader

    def testHeader(self):
        '''
        Lines starting with up to 3 # signs should be wrapped in header tages
        '''
        self.assertEqual(
		run_markdown('#this should be wrapped in h1 tags'),
		'<h1>this should be wrapped in h1 tags</h1>')

        self.assertEqual(
		run_markdown('##this should be wrapped in h2 tags'),
		'<h2>this should be wrapped in h2 tags</h2>')

        self.assertEqual(
	        run_markdown('###this should be wrapped in h3 tags'),
		'<h3>this should be wrapped in h3 tags</h3>')
开发者ID:lsilvestro96,项目名称:csci2963-labs,代码行数:15,代码来源:test_markdown_unittest.py


示例5: test_h3

 def test_h3(self):
     
     #Lines surrounded by 3 pound symbols should be wrapped in 'h3' tags
     
     self.assertEqual( 
             run_markdown('###this should not be wrapped in 3 pound tags###'),
             '<p><h3>this should not be wrapped in 3 pound tags</h3></p>')
开发者ID:olivierpo,项目名称:lab6,代码行数:7,代码来源:test_markdown_unittest.py


示例6: test_blockQuote

    def test_blockQuote(self):
	
	#Lines with '>' should be wrapped with blockquote tags
	
	self.assertEqual(
                run_markdown('>this should be wrapped in blockquote tags\n>and this too\nbut not this'),
        	'<blockquote><p>this should be wrapped in blockquote tags</p> <p>and this too</p> </blockquote><p>but not this</p>')
开发者ID:SeanWaclawik,项目名称:open_source,代码行数:7,代码来源:test_markdown_unittest.py


示例7: test_h1

 def test_h1(self):
     '''
     Lines starting with # should be wrapped in 'h1' tags
     '''
     self.assertEqual(
             run_markdown('#this should be wrapped in h1 tags\n'),
             '<p><h1>this should be wrapped in h1 tags</h1></p>')
开发者ID:Arrioj,项目名称:OpenSource-s16,代码行数:7,代码来源:test_markdown_unittest.py


示例8: test_em

 def test_em(self):
     '''
     Lines surrounded by asterisks should be wrapped in 'em' tags
     '''
     self.assertEqual( 
             run_markdown('*this should be wrapped in em tags*'),
             '<p><em>this should be wrapped in em tags</em></p>')
开发者ID:Arrioj,项目名称:OpenSource-s16,代码行数:7,代码来源:test_markdown_unittest.py


示例9: test_BlockQuotes

 def test_BlockQuotes(self):
     '''
     Lines surrounded by double asterisks should be wrapped in 'H1' tags
     '''
     self.assertEqual( 
             run_markdown('>this should be wrapped in blockquotes\nthis should not be'),
             '<p><blockquote>this should be wrapped in blockquotes</p>\n<p>this should not be</p>')
开发者ID:dangothemango,项目名称:OpenSource,代码行数:7,代码来源:test_markdown_unittest.py


示例10: test_H1

 def test_H1(self):
     '''
     Lines surrounded by double asterisks should be wrapped in 'H1' tags
     '''
     self.assertEqual( 
             run_markdown('#this should be wrapped in H1 tags'),
             '<p><h1>this should be wrapped in H1 tags</h1></p>')
开发者ID:dangothemango,项目名称:OpenSource,代码行数:7,代码来源:test_markdown_unittest.py


示例11: test_em

 def test_em(self):
     """
     Lines surrounded by asterisks should be wrapped in 'em' tags
     """
     self.assertEqual(
         run_markdown("*this should be wrapped in em tags*"), "<p><em>this should be wrapped in em tags</em></p>"
     )
开发者ID:GrahamAtkinson035,项目名称:Open-Source-Lab-Work,代码行数:7,代码来源:lab6pytest.py


示例12: test_blockquote

 def test_blockquote(self):
         '''
         Lines starting with >
         '''
         self.assertEqual(
         run_markdown('> this should be wrapped in blockquote tags\r\n>hi'),
         '<blockquote>\r\n<p> this should be wrapped in blockquote tags</p> <p>hi</p> </blockquote>')
开发者ID:patels13,项目名称:Open-Source,代码行数:7,代码来源:tests_markdown.py


示例13: test_Block

 def test_Block(self):
     '''
     Lines preceded by the more than symbol(>) should be wrapped in 'blockquote' tags
     '''
     self.assertEqual( 
             run_markdown('>this should be wrapped in blockquote tags'),
             '<p><blockquote>this should be wrapped in blockquote tags\n</blockquote></p>')
开发者ID:nathanpotolsky,项目名称:CSCI-2963,代码行数:7,代码来源:test_markdown_unittest.py


示例14: test_H3

 def test_H3(self):
     '''
     Lines preceded by three pound symbols(###) should be wrapped in 'h3' tags
     '''
     self.assertEqual( 
             run_markdown('###this should be wrapped in h3 tags'),
             '<p><h3>this should be wrapped in h3 tags</h3></p>')
开发者ID:nathanpotolsky,项目名称:CSCI-2963,代码行数:7,代码来源:test_markdown_unittest.py


示例15: test_H2

 def test_H2(self):
     '''
     Lines preceded by two pound symbols(##) should be wrapped in 'h2' tags
     '''
     self.assertEqual( 
             run_markdown('##this should be wrapped in h2 tags'),
             '<p><h2>this should be wrapped in h2 tags</h2></p>')
开发者ID:nathanpotolsky,项目名称:CSCI-2963,代码行数:7,代码来源:test_markdown_unittest.py


示例16: test_H1

 def test_H1(self):
     '''
     Lines preceded by one pound symbol(#) should be wrapped in 'h1' tags
     '''
     self.assertEqual( 
             run_markdown('#this should be wrapped in h1 tags'),
             '<p><h1>this should be wrapped in h1 tags</h1></p>')
开发者ID:nathanpotolsky,项目名称:CSCI-2963,代码行数:7,代码来源:test_markdown_unittest.py


示例17: test_header1

 def test_header1(self):
     """
     Lines started with # should be wrapped in h1 tags
     """
     self.assertEqual(
         run_markdown("#this should be wrapped in h1 tags"), "<p><h1>this should be wrapped in h1 tags</h1></p>"
     )
开发者ID:erinjordan24,项目名称:OpenSourceLabs,代码行数:7,代码来源:test_markdown_unittest.py


示例18: test_h2

 def test_h2(self):
     
     #Lines surrounded by 2 pound symbols should be wrapped in 'h2' tags
     
     self.assertEqual( 
             run_markdown('##this should be wrapped in h2 tags##'),
             '<p><h2>this should be wrapped in h2 tags</h2></p>')
开发者ID:olivierpo,项目名称:lab6,代码行数:7,代码来源:test_markdown_unittest.py


示例19: test_H1

 def test_H1(self):
     
     #Lines surrounded by pound symbol should be wrapped in 'h1' tags
     
     self.assertEqual( 
             run_markdown('#this should be wrapped in h1 tags#'),
             '<p><h1>this should be wrapped in h1 tags</h1></p>')
开发者ID:olivierpo,项目名称:lab6,代码行数:7,代码来源:test_markdown_unittest.py


示例20: test_header

 def test_header(self):
     """
     Lines starting with pound signs should be wrapped in 'h1' tags
     """
     self.assertEqual(
         run_markdown("#this should be wrapped in h1 tags"), "<p><h1>this should be wrapped in h1 tags</h1></p>"
     )
开发者ID:GrahamAtkinson035,项目名称:Open-Source-Lab-Work,代码行数:7,代码来源:lab6pytest.py



注:本文中的markdown_adapter.run_markdown函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python markdown_deux.markdown函数代码示例发布时间:2022-05-27
下一篇:
Python markdown2.markdown_path函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap