Commit 70555e6c authored by Andreas Jung's avatar Andreas Jung

Collector #432: STX special characters inside a literal were not

printed properly
parent 28e6af93
......@@ -294,6 +294,7 @@ class DocumentClass:
#'doc_named_link',
#'doc_underline'
text_types = [
'doc_literal',
'doc_sgml',
'doc_inner_link',
'doc_named_link',
......@@ -301,7 +302,6 @@ class DocumentClass:
'doc_href2',
'doc_strong',
'doc_emphasize',
'doc_literal',
'doc_underline',
'doc_sgml',
'doc_xref',
......
......@@ -140,50 +140,58 @@ class BasicTests(unittest.TestCase):
def testUnderline(self):
"""underline"""
self._test("xx _this is html_ xx",
"xx <u>this is html</u> xx")
def testUnderline1(self):
"""underline 1"""
self._test("xx _this is html_",
"<u>this is html</u>")
def testEmphasis(self):
""" emphasis """
self._test("xx *this is html* xx",
"xx <em>this is html</em> xx")
def testStrong(self):
""" strong """
self._test("xx **this is html** xx",
"xx <strong>this is html</strong> xx")
def testUnderlineThroughoutTags(self):
"""Underlined text containing tags should not be transformed"""
self._test('<a href="index_html">index_html</a>',
'<a href="index_html">index_html</a>')
def testUnderscoresInLiteral1(self):
""" underscores in literals shouldn't do underlining (1)"""
self._test("def __init__(self)",
"def __init__(self)")
def testUnderscoresInLiteral2(self):
""" underscores in literals shouldn't do underlining (2)"""
self._test("this is '__a_literal__' eh",
"<code>__a_literal__</code>")
def testUnderlinesWithoutWithspaces(self):
""" underscores in literals shouldn't do underlining (3)"""
self._test("Zopes structured_text is sometimes a night_mare",
"Zopes structured_text is sometimes a night_mare")
def testAsterisksInLiteral(self):
self._test("this is a '*literal*' eh",
"<code>*literal*</code>")
def testDoubleAsterisksInLiteral(self):
self._test("this is a '**literal**' eh",
"<code>**literal**</code>")
def testLinkInLiteral(self):
self._test("this is a '\"literal\":http://www.zope.org/.' eh",
'<code>"literal":http://www.zope.org/.</code>')
def test_suite():
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite( StructuredTextTests ) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment