[Epydoc-commits] SF.net SVN: epydoc: [1460] trunk/epydoc/src/epydoc
Brought to you by:
edloper
From: <ed...@us...> - 2007-02-11 06:07:28
|
Revision: 1460 http://svn.sourceforge.net/epydoc/?rev=1460&view=rev Author: edloper Date: 2007-02-10 22:07:27 -0800 (Sat, 10 Feb 2007) Log Message: ----------- - Fixed SF bug 1562530, which causes nested literal braces to not get parsed correctly. Modified Paths: -------------- trunk/epydoc/src/epydoc/markup/epytext.py trunk/epydoc/src/epydoc/test/epytext.doctest Modified: trunk/epydoc/src/epydoc/markup/epytext.py =================================================================== --- trunk/epydoc/src/epydoc/markup/epytext.py 2007-02-11 05:52:55 UTC (rev 1459) +++ trunk/epydoc/src/epydoc/markup/epytext.py 2007-02-11 06:07:27 UTC (rev 1460) @@ -1064,7 +1064,7 @@ # Special handling for literal braces elements: if stack[-1].tag == 'litbrace': - stack[-2].children = ['{'] + stack[-1].children + ['}'] + stack[-2].children[-1:] = ['{'] + stack[-1].children + ['}'] # Special handling for graphs: if stack[-1].tag == 'graph': Modified: trunk/epydoc/src/epydoc/test/epytext.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/epytext.doctest 2007-02-11 05:52:55 UTC (rev 1459) +++ trunk/epydoc/src/epydoc/test/epytext.doctest 2007-02-11 06:07:27 UTC (rev 1460) @@ -282,3 +282,27 @@ ... This is detached ... """) ('Other lines without period...', True) + +Literal Braces +============== +SF bug #1562530 reported some trouble with literal braces. These +tests make sure that braces are getting rendered as desired. + +>>> def epytext2html(s): +... errs = [] +... v = epytext.parse_docstring(s, errs).to_html(None) +... for err in errs: print err +... return (v or '').rstrip() + +>>> print epytext2html("{1:{2:3}}") + {1:{2:3}} +>>> print epytext2html("C{{1:{2:3}}}") +<code>{1:{2:3}}</code> +>>> print epytext2html("{1:C{{2:3}}}") +{1:<code>{2:3}</code>} +>>> print epytext2html("{{{}{}}{}}") + {{{}{}}{}} +>>> print epytext2html("{{E{lb}E{lb}E{lb}}}") + {{{{{}} + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |