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:
|
||||
cmd = u"%s" % cmd # ensure it is an unicode instance
|
||||
cmd = cmd.translate(licr_table)
|
||||
cmd = cmd.replace("\\", "\\backslash\n")
|
||||
cmd = cmd.replace("\\", "\n\\backslash\n")
|
||||
ret += cmd.splitlines()
|
||||
ret += ["\\end_layout", "", "\\end_inset"]
|
||||
return ret
|
||||
|
@ -25,18 +25,21 @@ import unittest
|
||||
class TestParserTools(unittest.TestCase):
|
||||
|
||||
def test_put_cmd_in_ert(self):
|
||||
ert = ['\\begin_inset ERT',
|
||||
'status collapsed',
|
||||
'',
|
||||
'\\begin_layout Plain Layout',
|
||||
'',
|
||||
ert = [u'\\begin_inset ERT',
|
||||
u'status collapsed',
|
||||
u'',
|
||||
u'\\begin_layout Plain Layout',
|
||||
u'',
|
||||
u'',
|
||||
u'\\backslash',
|
||||
u'texttt{Gr',
|
||||
u'\\backslash',
|
||||
u'"{u}',
|
||||
u'\\backslash',
|
||||
u'texttt{Gr\\backslash',
|
||||
u'"{u}\\backslash',
|
||||
u'ss{}e}',
|
||||
'\\end_layout',
|
||||
'',
|
||||
'\\end_inset']
|
||||
u'\\end_layout',
|
||||
u'',
|
||||
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user