--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Perhaps set the filter level to none, and perform filtering when it's rendered.
Yes, given that the output of the markdown filter is pure HTML, it makes sense to clean after the markdown filter, not before it.
However, this reverses the Mezzanine flow. Mezzanine cleans first in the RichTextField itself, then runs the rendering filter (e.g. markdown) in the template.
So, to implement this, I'd need to disable Mezzanine's cleaning (by setting RICHTEXT_FILTER_LEVEL to 3/None), and provide my own clean filter to use it in the template.
The worse side effect of this approach, IMO, is that switching between tinymce and pagedown would not be transparent anymore. To switch to pagedown, you must:
page.richtextpage.content|richtext_filter|safepage.richtextpage.content|richtext_filter|clean|safe(clean can be called by richtext_filter, but the following problem still applies)
Another problem with calling a clean filter is that it cannot use the RICHTEXT_FILTER_LEVEL setting, because it must be set to None! So the filter level configurability is lost. Even worse, if a safe clean is used by default, it will drive the user crazy trying to figure out why things are stripped out despite setting the filter level to None!
A completely different solution is to keep things as they are, and reverse the effect of the wrongful escape afterwards, by replacing > occurrences that should produce blockquotes with > back.
Not sure where to go from here..
Hey Ahmad you could set up a custom richtext_filter that first converted markdown to html and then cleaned, that way the template code wouldn't have to change at all.
(clean can be called by richtext_filter, but the following problem still applies)
Another problem with calling a
cleanfilter is that it cannot use the RICHTEXT_FILTER_LEVEL setting, because it must be set to None! So the filter level configurability is lost. Even worse, if a safecleanis used by default, it will drive the user crazy trying to figure out why things are stripped out despite setting the filter level to None!