Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown filter and paragraph line break #63

Open
jbjuin opened this issue Mar 9, 2018 · 2 comments
Open

Markdown filter and paragraph line break #63

jbjuin opened this issue Mar 9, 2018 · 2 comments
Labels

Comments

@jbjuin
Copy link

jbjuin commented Mar 9, 2018

Hi !
It seems that there is a problem with the mardown filter.

What I see

A line break in a markdown paragraph trigger the creation of a line break in the ODT.

fdsfdsf fdsf dsf fdsfdsf fdsfdsfdsf
fds fdsf fdsg gds gfdsg fdsg fds gfd

This generates a line break in the ODT which renders pretty badly with a justified text and a short line.

What I expect

My feeling is that a line break in a md paragraph should be rendered without line break in the ODT.
In markdown only a "double space" at the end of a line in paragraph triggers a linebreak in the result.
This avoid the text wrap in editor. You can just go at the line when you want and as soon as you do not double space you stay in the same paragraph.

Suggestion

I just discovered mistune a fast python markdown parser.
With mistune one can write a Renderer to output the parsed markdown. I started writing an ODTRenderer (it's quite easy !) but then found out that secretary has a markdown filter and stopped.

Such renderer as a markdown filter logic replacement may be easier to maintain.

What is you position about dependencies ?

Do you accept pull requests on this project ? I may be interested to do one on this subject.

Anyway Secretary is pretty cool ! Thank you for your effort on this !

@christopher-ramirez
Copy link
Owner

Hello!

Thank you for this post.

In markdown only a "double space" at the end of a line in paragraph triggers a linebreak in the result.

Which version of Secretary are you using? There's was a regression bug that caused this. The latest version should not be affected.

What is you position about dependencies ?

New dependencies are OK as long as they do not depend on native libraries or some special settings on the host machine. PIL for example is a no-no.

Do you accept pull requests on this project ? I may be interested to do one on this subject.

Yes. Pull request are welcome.

Ragards

@screwt
Copy link

screwt commented May 22, 2018

Hi i can reproduce this behavior with the libraries bellow:

Jinja2==2.10
markdown2==2.3.5
MarkupSafe==1.0
python-dateutil==2.7.2
secretary==0.2.19
six==1.11.0

Is the problem there?:

return (result

Seems ok with master branch, last release 0.2.19 is not ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants