aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--screenplain/parsers/spmd.py2
-rw-r--r--tests/spmd_test.py20
2 files changed, 15 insertions, 7 deletions
diff --git a/screenplain/parsers/spmd.py b/screenplain/parsers/spmd.py
index 2d101ac..76a5028 100644
--- a/screenplain/parsers/spmd.py
+++ b/screenplain/parsers/spmd.py
@@ -19,7 +19,7 @@ slug_prefixes = (
TWOSPACE = ' ' * 2
-centered_re = re.compile(r'\s*>\s*(.*)\s*<$')
+centered_re = re.compile(r'\s*>\s*(.*)\s*<\s*$')
def is_blank(string):
return string == '' or string.isspace() and string != ' '
diff --git a/tests/spmd_test.py b/tests/spmd_test.py
index d5a4615..ee4cd19 100644
--- a/tests/spmd_test.py
+++ b/tests/spmd_test.py
@@ -214,13 +214,19 @@ class ParseTests(unittest2.TestCase):
self.assertTrue(paras[0].centered)
def test_full_centered_paragraph(self):
- paras = list(parse([
+ lines = [
'> first! <',
- ' > second! <',
- '> third! <',
- ]))
+ ' > second! <',
+ '> third!< ',
+ ]
+ paras = list(parse(lines))
self.assertEquals([Action], [type(p) for p in paras])
self.assertTrue(paras[0].centered)
+ self.assertEquals([
+ plain('first!'),
+ plain('second!'),
+ plain('third!'),
+ ], paras[0].lines)
def test_upper_case_centered_not_parsed_as_dialog(self):
paras = list(parse([
@@ -232,13 +238,15 @@ class ParseTests(unittest2.TestCase):
self.assertTrue(paras[0].centered)
def test_centering_marks_in_middle_of_paragraphs_are_verbatim(self):
- paras = list(parse([
+ lines = [
'first!',
'> second! <',
'third!',
- ]))
+ ]
+ paras = list(parse(lines))
self.assertEquals([Action], [type(p) for p in paras])
self.assertFalse(paras[0].centered)
+ self.assertEquals([plain(line) for line in lines], paras[0].lines)
if __name__ == '__main__':
unittest2.main()