Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _paragraph(self, **kwargs):
path = PathInfo().append("body").append("p")
paragraph = Paragraph(path)
for n, v in kwargs.items():
if n == "text":
paragraph.append_text(v)
else:
setattr(paragraph, n, v)
return paragraph
def _start_new_pragraph(self):
if self.paragraph and self.paragraph.contains_text():
self.paragraphs.append(self.paragraph)
self.paragraph = Paragraph(self.path)