Example #1
0
 def get_short_readme(self, data):
     version = filter(lambda t: t.tag == 'latest', data.tags)[0]
     readme_short_markdown = text_to_markdown(version.readme or '')
     readme_short = ''.join(BeautifulSoup(readme_short_markdown).findAll(text=True)) \
         .split('\n\n')[0].replace(' \n', '') \
         .replace('\n', ' ').replace('/^ /', '')
     return readme_short
Example #2
0
 def test_blockquotes_working(self):
     self.assertEqual(
         text_to_markdown("> this is a blockquote"),
         '<blockquote>\n<p>this is a blockquote</p>\n</blockquote>')
Example #3
0
 def test_allowed_attr_working(self):
     self.assertEqual(
         text_to_markdown("<a href='https://example.com'>test</a>"),
         '<p><a href="https://example.com">test</a></p>')
Example #4
0
 def test_disallowed_tags(self):
     self.assertEqual(text_to_markdown("<script>test</script>"),
                      "&lt;script&gt;test&lt;/script&gt;")
Example #5
0
 def test_allowed_tags_working(self):
     self.assertEqual(text_to_markdown("<h1>test</h1>"), "<h1>test</h1>")
 def get_short_readme(self, data):
     readme_short_markdown = text_to_markdown(data.readme or '')
     readme_short = ''.join(BeautifulSoup(readme_short_markdown).findAll(text=True)) \
         .split('\n\n')[0].replace(' \n', '') \
         .replace('\n', ' ').replace('/^ /', '')
     return readme_short
 def get_readme(self, data):
     readme_variables_replaced = dp_in_readme(data.readme or '', data.descriptor)
     readme = text_to_markdown(readme_variables_replaced)
     return readme
Example #8
0
 def get_readme(self, data):
     version = filter(lambda t: t.tag == 'latest', data.tags)[0]
     readme_variables_replaced = dp_in_readme(version.readme or '',
                                              version.descriptor)
     readme = text_to_markdown(readme_variables_replaced)
     return readme