mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Parse markdown tables and show them with some styling
(imported from commit fb3c599b1dbaed2447f1e710ed7202486000ca2a)
This commit is contained in:
		@@ -3254,6 +3254,40 @@ But you can never leave**"""
 | 
			
		||||
 | 
			
		||||
        self.assertEqual(converted, '<p>We should fix <a href="https://trac.zulip.net/ticket/224" target="_blank" title="https://trac.zulip.net/ticket/224">#224</a> and <a href="https://trac.zulip.net/ticket/115" target="_blank" title="https://trac.zulip.net/ticket/115">#115</a>, but not issue#124 or #1124z or <a href="https://trac.zulip.net/ticket/16" target="_blank" title="https://trac.zulip.net/ticket/16">trac #15</a> today.</p>')
 | 
			
		||||
 | 
			
		||||
    def test_tables(self):
 | 
			
		||||
        msg = """This is a table:
 | 
			
		||||
 | 
			
		||||
First Header  | Second Header
 | 
			
		||||
------------- | -------------
 | 
			
		||||
Content Cell  | Content Cell
 | 
			
		||||
Content Cell  | Content Cell
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
        expected = """<p>This is a table:</p>
 | 
			
		||||
<table>
 | 
			
		||||
<thead>
 | 
			
		||||
<tr>
 | 
			
		||||
<th>First Header</th>
 | 
			
		||||
<th>Second Header</th>
 | 
			
		||||
</tr>
 | 
			
		||||
</thead>
 | 
			
		||||
<tbody>
 | 
			
		||||
<tr>
 | 
			
		||||
<td>Content Cell</td>
 | 
			
		||||
<td>Content Cell</td>
 | 
			
		||||
</tr>
 | 
			
		||||
<tr>
 | 
			
		||||
<td>Content Cell</td>
 | 
			
		||||
<td>Content Cell</td>
 | 
			
		||||
</tr>
 | 
			
		||||
</tbody>
 | 
			
		||||
</table>"""
 | 
			
		||||
 | 
			
		||||
        converted = bugdown_convert(msg)
 | 
			
		||||
 | 
			
		||||
        print converted
 | 
			
		||||
        self.assertEqual(converted, expected)
 | 
			
		||||
 | 
			
		||||
class UserPresenceTests(AuthedTestCase):
 | 
			
		||||
 | 
			
		||||
    def common_init(self, email):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user