Closed j123b567 closed 6 years ago
Hello! Thanks for you comments
Any PR is welcome. You may patch to current version and then I transfer those to the development branch.
There is still something strange for me. In the commit aecd401c6e5e693263c38fadd15f4f465f8431c8 solving issue #47, the solution is completely against my ideas, because it adds .replace('\n', '<text:line-break/>')
that I would like to remove. Removing this still solves #47 for python 2.7 and 3.4.
Markdown filter converts the text into pure html so there is no need to play with line breaks. Only one exception should be preformated text.
The implementation of
node_to_string()
and_node_to_str()
is wrong, because it replaces all\n\n
with new empty paragraph.This is big problem for lists, because it adds unavoidable new lines around the list.
This should generate
but current output is
Main problem is unwanted
<text:p text:style-name="Standard"/>
before the list and<text:line-break/>
after the list. Other line breaks are silently ignored.It can be solved just by removing the replace functions
.replace('\n\n', '<text:p text:style-name="Standard"/>'
and.replace('\n', '<text:line-break/>')
but this change breaks preformated texts. Problem is in conditionnode.getAttribute('text:style-name') == 'Preformatted_20_Text'
that is never true, because it is evaluated only on parent element and not on all its childs.I would like to provide PR, but I don't know, which version is the future of the project. Development branch is broken and completely different, but seems to be the future. Or should I still post PRs against master branch?