diff options
| author | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2011-06-04 09:32:20 +0000 |
|---|---|---|
| committer | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2011-06-04 09:32:20 +0000 |
| commit | 8e84c9612a33a3add9f02b2c2c0891a1620c539a (patch) | |
| tree | 0f1c5ab60814003878cd1a608bd3d89a6d78c9ba | |
| parent | 2eb44435b0798796e664ad23ba5d141e879d639a (diff) | |
| download | docutils-8e84c9612a33a3add9f02b2c2c0891a1620c539a.tar.gz | |
Fix: regexp possible roff command and add test for it
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7046 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
| -rw-r--r-- | docutils/writers/manpage.py | 2 | ||||
| -rw-r--r-- | test/test_writers/test_manpage.py | 45 |
2 files changed, 46 insertions, 1 deletions
diff --git a/docutils/writers/manpage.py b/docutils/writers/manpage.py index 5f2981930..ec5ceff21 100644 --- a/docutils/writers/manpage.py +++ b/docutils/writers/manpage.py @@ -155,7 +155,7 @@ class Translator(nodes.NodeVisitor): """""" words_and_spaces = re.compile(r'\S+| +|\n') - possibly_a_roff_command = re.compile(r'.\w') + possibly_a_roff_command = re.compile(r'\.\w') document_start = """Man page generated from reStructeredText.""" def __init__(self, document): diff --git a/test/test_writers/test_manpage.py b/test/test_writers/test_manpage.py index d3eeb5aa5..b49e33590 100644 --- a/test/test_writers/test_manpage.py +++ b/test/test_writers/test_manpage.py @@ -260,6 +260,51 @@ bla bla bla ."""], ] +totest['definitionlist'] = [ + [""" +==================== +Definition List Test +==================== + +:Abstract: Docinfo is required. + +Section +======= + +:term1: + + Description of Term 1 Description of Term 1 Description of Term 1 + Description of Term 1 Description of Term 1 + + Description of Term 1 Description of Term 1 Description of Term 1 + Description of Term 1 Description of Term 1 + +""", +'''\ +.TH DEFINITION LIST TEST "" "" "" +.SH NAME +Definition List Test \\- \n\ +.\\" Man page generated from reStructeredText. +. +.SS Abstract +.sp +Docinfo is required. +.SH SECTION +.INDENT 0.0 +.TP +.B term1 +. +Description of Term 1 Description of Term 1 Description of Term 1 +Description of Term 1 Description of Term 1 +.sp +Description of Term 1 Description of Term 1 Description of Term 1 +Description of Term 1 Description of Term 1 +.UNINDENT +.\\" Generated by docutils manpage writer. +.\\" \n\ +.'''], + ] + if __name__ == '__main__': import unittest |
