##// END OF EJS Templates
upgrading >v4 header cells to unicode...
Nicholas Bollweg (Nick) -
Show More
@@ -91,7 +91,7 b' def upgrade_cell(cell):'
91 elif cell.cell_type == 'heading':
91 elif cell.cell_type == 'heading':
92 cell.cell_type = 'markdown'
92 cell.cell_type = 'markdown'
93 level = cell.pop('level', 1)
93 level = cell.pop('level', 1)
94 cell.source = '{hashes} {single_line}'.format(
94 cell.source = u'{hashes} {single_line}'.format(
95 hashes='#' * level,
95 hashes='#' * level,
96 single_line = ' '.join(cell.get('source', '').splitlines()),
96 single_line = ' '.join(cell.get('source', '').splitlines()),
97 )
97 )
@@ -1,3 +1,4 b''
1 # -*- coding: utf-8 -*-
1 import copy
2 import copy
2
3
3 import nose.tools as nt
4 import nose.tools as nt
@@ -33,6 +34,10 b' def test_upgrade_heading():'
33 v3h(source='foo\nbar\nmulti-line\n', level=4),
34 v3h(source='foo\nbar\nmulti-line\n', level=4),
34 v4m(source='#### foo bar multi-line'),
35 v4m(source='#### foo bar multi-line'),
35 ),
36 ),
37 (
38 v3h(source='unicode–conversion', level=4),
39 v4m(source=u'#### unicode–conversion'),
40 ),
36 ]:
41 ]:
37 upgraded = convert.upgrade_cell(v3cell)
42 upgraded = convert.upgrade_cell(v3cell)
38 nt.assert_equal(upgraded, expected)
43 nt.assert_equal(upgraded, expected)
General Comments 0
You need to be logged in to leave comments. Login now