From: Yuri T. <qar...@gm...> - 2007-11-05 06:08:37
|
> until just now (after committing my patch). One could already have > code that sets `HTML_REMOVED_TEXT` to an empty string so that all html > is stripped and replaced with nothing. Some may prefer such a > behavior. This makes that imposable to do. Is anyone doing this? This does seem like a reasonable thing to allow. Why not use None instead of empty string as the code for escaping, testing for type(HTML_REMOVED_TEXT) == "string"? > Another solution would be to change the expected values of the > `safe_mode` parameter for Markdown() to one of 'strip', 'escape', or > None rather than True/False. But that could get complicated/confusing. This is actually quote reasonable, except that we could make it more more backwards compatible by saying that safe_mode = None would turn it off, safe_mode = "escape" would escape the HTML, and "remove" or any other non-false value would replace HTML with the value of HTML_REMOVED_TEXT. I think for the documentation we should tell people to put "replace", but the actual code should treat any true value other than "escape" as meaning "removed". > I should also mention that I also moved the code that does the > escaping/removing from the convert method to a text-post-processor. It > makes more sense there regardless of this change IMO and simplifies > the process of making your own extension to change the behavior. > Extensions would be another way to address the issues I mention above. > Perhaps we could just leave it at that. I am glad you did it, but it would be nice to have a simpler solution, that does not depend on groking extensions. Thanks for all the work! When do you think we should make a release of 1.7? - yuri -- Yuri Takhteyev Ph.D. Candidate, UC Berkeley School of Information http://takhteyev.org/, http://www.freewisdom.org/ |