Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_a_with_title(self):
self.assertEqual(
md('<a title="The "Goog"" href="http://google.com">Google</a>'),
r'[Google](http://google.com "The \"Goog\"")'
)
def test_img():
assert md('<img title="Optional title" alt="Alt text" src="/path/to/img.jpg">') == '![Alt text](/path/to/img.jpg "Optional title")'
assert md('<img alt="Alt text" src="/path/to/img.jpg">') == '![Alt text](/path/to/img.jpg)'
def test_do_not_convert(self):
self.assertEqual(
md('<a href="https://github.com/matthewwithanm">Some Text</a>', convert=[]),
'Some Text')
def test_whitespace(self):
self.assertEqual(md(' a b \n\n c '), ' a b c ')
def test_a_no_autolinks():
text = md('<a href="http://google.com">http://google.com</a>', autolinks=False)
assert text == '[http://google.com](http://google.com)'
def test_ol():
assert md('<ol><li>a</li><li>b</li></ol>') == '1. a\n2. b\n'
def test_b(self):
self.assertEqual(md('<b>Hello</b>'), '**Hello**')
def test_ul():
assert md('<ul><li>a</li><li>b</li></ul>') == '* a\n* b\n'
def test_ol(self):
self.assertEqual(md('<ol><li>a</li><li>b</li></ol>'), '1. a\n2. b\n')
import demistomock as demisto
from CommonServerPython import *
from markdownify import markdownify as md
return_outputs(md(demisto.getArg('html')))