Merge pull request #2428 from FinnStutzenstein/Issue2425
Removing PDF paragraph numbering (fixes #2425)
This commit is contained in:
commit
4363c3498a
@ -227,12 +227,3 @@ def get_config_variables():
|
|||||||
weight=375,
|
weight=375,
|
||||||
group='Motions',
|
group='Motions',
|
||||||
subgroup='Export')
|
subgroup='Export')
|
||||||
|
|
||||||
yield ConfigVariable(
|
|
||||||
name='motions_pdf_paragraph_numbering',
|
|
||||||
default_value=False,
|
|
||||||
input_type='boolean',
|
|
||||||
label='Show paragraph numbering (only in PDF)',
|
|
||||||
weight=380,
|
|
||||||
group='Motions',
|
|
||||||
subgroup='Export')
|
|
||||||
|
@ -273,7 +273,6 @@ def convert_html_to_reportlab(pdf, text):
|
|||||||
tag.unwrap()
|
tag.unwrap()
|
||||||
# print paragraphs with numbers
|
# print paragraphs with numbers
|
||||||
text = soup.body.contents
|
text = soup.body.contents
|
||||||
paragraph_number = 1
|
|
||||||
for paragraph in text:
|
for paragraph in text:
|
||||||
paragraph = str(paragraph)
|
paragraph = str(paragraph)
|
||||||
# ignore empty paragraphs (created by newlines/tabs of ckeditor)
|
# ignore empty paragraphs (created by newlines/tabs of ckeditor)
|
||||||
@ -281,10 +280,6 @@ def convert_html_to_reportlab(pdf, text):
|
|||||||
continue
|
continue
|
||||||
if "<pre>" in paragraph:
|
if "<pre>" in paragraph:
|
||||||
txt = paragraph.replace('\n', '<br/>').replace(' ', ' ')
|
txt = paragraph.replace('\n', '<br/>').replace(' ', ' ')
|
||||||
if config["motions_pdf_paragraph_numbering"]:
|
|
||||||
pdf.append(Paragraph(txt, stylesheet['InnerMonotypeParagraph'], str(paragraph_number)))
|
|
||||||
paragraph_number += 1
|
|
||||||
else:
|
|
||||||
pdf.append(Paragraph(txt, stylesheet['InnerMonotypeParagraph']))
|
pdf.append(Paragraph(txt, stylesheet['InnerMonotypeParagraph']))
|
||||||
elif "<para>" in paragraph:
|
elif "<para>" in paragraph:
|
||||||
pdf.append(Paragraph(paragraph, stylesheet['InnerListParagraph']))
|
pdf.append(Paragraph(paragraph, stylesheet['InnerListParagraph']))
|
||||||
@ -296,10 +291,6 @@ def convert_html_to_reportlab(pdf, text):
|
|||||||
pdf.append(Paragraph(paragraph, stylesheet['InnerH2Paragraph']))
|
pdf.append(Paragraph(paragraph, stylesheet['InnerH2Paragraph']))
|
||||||
elif "<h3>" in paragraph:
|
elif "<h3>" in paragraph:
|
||||||
pdf.append(Paragraph(paragraph, stylesheet['InnerH3Paragraph']))
|
pdf.append(Paragraph(paragraph, stylesheet['InnerH3Paragraph']))
|
||||||
else:
|
|
||||||
if config["motions_pdf_paragraph_numbering"]:
|
|
||||||
pdf.append(Paragraph(paragraph, stylesheet['InnerParagraph'], str(paragraph_number)))
|
|
||||||
paragraph_number += 1
|
|
||||||
else:
|
else:
|
||||||
pdf.append(Paragraph(paragraph, stylesheet['InnerParagraph']))
|
pdf.append(Paragraph(paragraph, stylesheet['InnerParagraph']))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user