Commit 946ea6cc authored by Chris McDonough's avatar Chris McDonough

The doc_header method makes a copy of the paragraph it's working on and...

The doc_header method makes a copy of the paragraph it's working on and returns it in the case that what follows it is an example.  When doing so, the attributes attached to the paragraph were lost.  Changes made to the doc_header method copy the attributes assigned to the paragraph as well as the body, making the copy carry along paragraph attributes.
parent a0315998
......@@ -519,7 +519,7 @@ class DocumentClass:
result.append(paragraph)
return result
def doc_table(self, paragraph, expr = re.compile(r'\s*\|[-]+\|').match):
text = paragraph.getColorizableTexts()[0]
m = expr(text)
......@@ -849,8 +849,11 @@ class DocumentClass:
if top[-2:]=='::':
subs=StructuredTextExample(subs)
if strip(top)=='::': return subs
return ST.StructuredTextParagraph(
top[:-1], [subs], indent=paragraph.indent)
# copy attrs when returning a paragraph
kw = {}
atts = getattr(paragraph, '_attributes', [])
for att in atts: kw[att] = getattr(paragraph, att)
return apply(ST.StructuredTextParagraph, (top[:-1], [subs]), kw)
if find(top,'\n') >= 0: return None
return StructuredTextSection(top, subs, indent=paragraph.indent)
......
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