feed: ensure Markdown rendering is applied to feeds
This commit is contained in:
parent
45f6b1eda3
commit
01cf96eeb7
@ -345,7 +345,7 @@ class TestComments(unittest.TestCase):
|
|||||||
|
|
||||||
self.post('/new?uri=%2Fpath%2F', data=json.dumps({'text': 'First'}))
|
self.post('/new?uri=%2Fpath%2F', data=json.dumps({'text': 'First'}))
|
||||||
self.post('/new?uri=%2Fpath%2F',
|
self.post('/new?uri=%2Fpath%2F',
|
||||||
data=json.dumps({'text': 'First', 'parent': 1}))
|
data=json.dumps({'text': '*Second*', 'parent': 1}))
|
||||||
|
|
||||||
rv = self.get('/feed?uri=%2Fpath%2F')
|
rv = self.get('/feed?uri=%2Fpath%2F')
|
||||||
self.assertEqual(rv.status_code, 200)
|
self.assertEqual(rv.status_code, 200)
|
||||||
@ -354,7 +354,7 @@ class TestComments(unittest.TestCase):
|
|||||||
data = re.sub('[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]+Z',
|
data = re.sub('[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]+Z',
|
||||||
'2018-04-01T10:00:00Z', data)
|
'2018-04-01T10:00:00Z', data)
|
||||||
self.assertEqual(data, """<?xml version=\'1.0\' encoding=\'utf-8\'?>
|
self.assertEqual(data, """<?xml version=\'1.0\' encoding=\'utf-8\'?>
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0"><updated>2018-04-01T10:00:00Z</updated><id>tag:example.org,2018:/isso/thread/path/</id><title>Comments for example.org/path/</title><entry><id>tag:example.org,2018:/isso/1/2</id><title>Comment #2</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-2" /><content type="html">First</content><thr:in-reply-to href="https://example.org/path/#isso-1" ref="tag:example.org,2018:/isso/1/1" /></entry><entry><id>tag:example.org,2018:/isso/1/1</id><title>Comment #1</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-1" /><content type="html">First</content></entry></feed>""")
|
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0"><updated>2018-04-01T10:00:00Z</updated><id>tag:example.org,2018:/isso/thread/path/</id><title>Comments for example.org/path/</title><entry><id>tag:example.org,2018:/isso/1/2</id><title>Comment #2</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-2" /><content type="html"><p><em>Second</em></p></content><thr:in-reply-to href="https://example.org/path/#isso-1" ref="tag:example.org,2018:/isso/1/1" /></entry><entry><id>tag:example.org,2018:/isso/1/1</id><title>Comment #1</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-1" /><content type="html"><p>First</p></content></entry></feed>""")
|
||||||
|
|
||||||
def testCounts(self):
|
def testCounts(self):
|
||||||
|
|
||||||
|
@ -925,7 +925,7 @@ class API(object):
|
|||||||
content = ET.SubElement(entry, 'content', {
|
content = ET.SubElement(entry, 'content', {
|
||||||
'type': 'html',
|
'type': 'html',
|
||||||
})
|
})
|
||||||
content.text = comment['text']
|
content.text = self.isso.render(comment['text'])
|
||||||
|
|
||||||
if comment['parent']:
|
if comment['parent']:
|
||||||
ET.SubElement(entry, 'thr:in-reply-to', {
|
ET.SubElement(entry, 'thr:in-reply-to', {
|
||||||
|
Loading…
Reference in New Issue
Block a user