mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
parent
8caa9701b9
commit
2b451f01f5
@ -146,7 +146,7 @@ def put_cmd_in_ert(cmd):
|
|||||||
else:
|
else:
|
||||||
cmd = u"%s" % cmd # ensure it is an unicode instance
|
cmd = u"%s" % cmd # ensure it is an unicode instance
|
||||||
cmd = cmd.translate(licr_table)
|
cmd = cmd.translate(licr_table)
|
||||||
cmd = cmd.replace("\\", "\\backslash\n")
|
cmd = cmd.replace("\\", "\n\\backslash\n")
|
||||||
ret += cmd.splitlines()
|
ret += cmd.splitlines()
|
||||||
ret += ["\\end_layout", "", "\\end_inset"]
|
ret += ["\\end_layout", "", "\\end_inset"]
|
||||||
return ret
|
return ret
|
||||||
|
@ -25,18 +25,21 @@ import unittest
|
|||||||
class TestParserTools(unittest.TestCase):
|
class TestParserTools(unittest.TestCase):
|
||||||
|
|
||||||
def test_put_cmd_in_ert(self):
|
def test_put_cmd_in_ert(self):
|
||||||
ert = ['\\begin_inset ERT',
|
ert = [u'\\begin_inset ERT',
|
||||||
'status collapsed',
|
u'status collapsed',
|
||||||
'',
|
u'',
|
||||||
'\\begin_layout Plain Layout',
|
u'\\begin_layout Plain Layout',
|
||||||
'',
|
u'',
|
||||||
|
u'',
|
||||||
|
u'\\backslash',
|
||||||
|
u'texttt{Gr',
|
||||||
|
u'\\backslash',
|
||||||
|
u'"{u}',
|
||||||
u'\\backslash',
|
u'\\backslash',
|
||||||
u'texttt{Gr\\backslash',
|
|
||||||
u'"{u}\\backslash',
|
|
||||||
u'ss{}e}',
|
u'ss{}e}',
|
||||||
'\\end_layout',
|
u'\\end_layout',
|
||||||
'',
|
u'',
|
||||||
'\\end_inset']
|
u'\\end_inset']
|
||||||
self.assertEqual(put_cmd_in_ert(u"\\texttt{Grüße}"), ert)
|
self.assertEqual(put_cmd_in_ert(u"\\texttt{Grüße}"), ert)
|
||||||
self.assertEqual(put_cmd_in_ert([u"\\texttt{Grüße}"]), ert)
|
self.assertEqual(put_cmd_in_ert([u"\\texttt{Grüße}"]), ert)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user