Mercurial > libervia-backend
comparison src/plugins/plugin_misc_text_syntaxes.py @ 836:2cc0201b4613
plugin text_syntaxes: rstrip the conversion result to avoid new lines systematically added by converters (e.g. html2text do this)
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 12 Feb 2014 15:21:00 +0100 |
parents | c4b22aedb7d7 |
children | 831f208b4ea3 |
comparison
equal
deleted
inserted
replaced
835:c00d90bce252 | 836:2cc0201b4613 |
---|---|
214 if TextSyntaxes.OPT_NO_THREAD in syntaxes[syntax_to]["flags"]: | 214 if TextSyntaxes.OPT_NO_THREAD in syntaxes[syntax_to]["flags"]: |
215 d.addCallback(syntaxes[syntax_to]["from"]) | 215 d.addCallback(syntaxes[syntax_to]["from"]) |
216 else: | 216 else: |
217 d.addCallback(lambda xhtml: deferToThread(syntaxes[syntax_to]["from"], xhtml)) | 217 d.addCallback(lambda xhtml: deferToThread(syntaxes[syntax_to]["from"], xhtml)) |
218 | 218 |
219 # converters can add new lines that disturb the microblog change detection | |
220 d.addCallback(lambda text: text.rstrip()) | |
219 return d | 221 return d |
220 | 222 |
221 def addSyntax(self, name, to_xhtml_cb, from_xhtml_cb, flags = None): | 223 def addSyntax(self, name, to_xhtml_cb, from_xhtml_cb, flags = None): |
222 """ Add a new syntax to the manager | 224 """ Add a new syntax to the manager |
223 @param name: unique name of the syntax | 225 @param name: unique name of the syntax |