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

[development] Markdown filter does not work anymore #61

Open
RomainTT opened this issue Feb 13, 2018 · 3 comments
Open

[development] Markdown filter does not work anymore #61

RomainTT opened this issue Feb 13, 2018 · 3 comments
Labels

Comments

@RomainTT
Copy link

I already said that I found an issue with the markdown filter but you did not seem to reproduce the issue... So I re-checked it more seriously and I can say I don't have any issue with the master branch, but it does not work on development.

Template

RAW CONTENT :
{{content}}
FILTERED CONTENT :
{{content|markdown}}
FILTERED CONTENT WITH SAFE :
{{content|markdown|safe}}

Code

from secretary import Renderer
template = 'template.odt'
engine = Renderer()
result = engine.render(template, content="hello world")
output = open('rendered_document.odt', 'wb')
output.write(result)

Output on master branch

RAW CONTENT :
hello world
FILTERED CONTENT :
hello world
FILTERED CONTENT WITH SAFE :
hello world

Output on development branch

RAW CONTENT :
hello world
FILTERED CONTENT :

FILTERED CONTENT WITH SAFE :

@christopher-ramirez
Copy link
Owner

Thank you for reporting this! I'll have a look into it.

A few changes have been introduced on the development branch with how the system outputs the final values. Maybe this has affected the Markdown filter since it work on much lower level.

@RomainTT
Copy link
Author

RomainTT commented Jun 1, 2018

Hi !
any news concerning this issue ?

@235
Copy link

235 commented Dec 27, 2018

So I spent a bit of time on this.

Markdown works, but there are few edge cases when it's not rendered in the final document (but xml is present):

  1. The most crucial one that {{ text|markdown }} cannot be nested inside of a paragraph. Basically, it required break lines around.
  2. Also, it's really recommended to make your variables as Input field (see the documentation), as it's hardcoded to look for those in the code.

So, things work, just not as generic to support all cases.

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