Improved list handling in RML

This commit is contained in:
Tom Price
2016-01-07 23:56:01 +00:00
parent 7e0e6b6b3e
commit 99e1def1bb
3 changed files with 9 additions and 10 deletions

View File

@@ -189,7 +189,7 @@
<para>{{ item.name }} <para>{{ item.name }}
{% if item.description %} {% if item.description %}
</para> </para>
<indent left="0.5cm"> <indent left="0.6cm">
{{ item.description|markdown:"rml" }} {{ item.description|markdown:"rml" }}
</indent> </indent>
<para> <para>

View File

@@ -32,16 +32,15 @@ def markdown_filter(text, format='html'):
for list in soup.findAll(['ul','ol']): for list in soup.findAll(['ul','ol']):
list['style'] = list.name list['style'] = list.name
for li in list.findAll('li'): for li in list.findAll('li', recursive=False):
p = soup.new_tag('p') text = li.find(text=True)
p.string = li.text text.wrap(soup.new_tag('p'))
li.string = ''
li.append(p)
indent = soup.new_tag('indent')
indent['left'] = '1.2cm'
content = list.replace_with(indent) if list.parent.name != 'li':
indent.append(content) indent = soup.new_tag('indent')
indent['left'] = '0.6cm'
list.wrap(indent)
# Paragraphs have a different tag # Paragraphs have a different tag
for p in soup('p'): for p in soup('p'):

Binary file not shown.