Add test cases for quotes in alt texts

This commit is contained in:
Daniel Andersson 2019-04-07 00:16:58 +02:00
parent 059e95d6f3
commit 816fc608e6
3 changed files with 4 additions and 4 deletions

View file

@ -23,7 +23,7 @@ Foo
Bar
![foo](/image.png "Example")
![foo "handle quotes"](/image.png "Example")
#!/bin/sh
python

View file

@ -226,13 +226,13 @@ class TestParsing(unittest.TestCase):
def test_image(self):
self.assertParses(
"""
![foo](/url "title")
![foo "handle quotes"](/url "title")
""",
"""
<?xml version="1.0" ?>
<document source="&lt;string&gt;">
<paragraph>
<image alt="foo" uri="/url"></image>
<image alt="foo &quot;handle quotes&quot;" uri="/url"></image>
</paragraph>
</document>
"""

View file

@ -129,7 +129,7 @@ class GenericTests(SphinxIntegrationTests):
def test_image(self):
output = self.read_file('index.html')
self.assertIn(
'<p><img alt="foo" src="image.png" /></p>',
'<p><img alt="foo &quot;handle quotes&quot;" src="image.png" /></p>',
output
)