Commit Graph

9 Commits

Author SHA1 Message Date
Nicolas Lempereur 8c77c711ee [FIX] website: escaping saved html content
Escape text nodes changed via the web editor before sending the content
it to the server controller.

It is done since the content is unescaped one time when being displayed,
and it is not done for inline style and script tags (which may be
injected by dropping a snippet) since that would break them.

replacing the solution in cdb900044.
2015-08-27 17:27:39 +02:00
Nicolas Lempereur cdb9000449 [FIX] website, base: escaping and unescaping html
When saving a template in version 8.0, html would be saved as it should
be displayed once on the site. In particular, if some text should be
escaped once send to the browser, it will be saved as such.

But when rendering, a text node content is unescaped two times:

* for translation which seems wrong since we already use .text of a node
  which already escaped it, doing it one more time is bad,

* when rendering the template, since the html template is stored in xml,

This commit remove superfluous unescaping for translation, and add an
escaping when saving the changed template content.

closes #7967
opw-646889
2015-08-13 15:15:24 +02:00
Xavier Morel 6b857b6eeb [FIX] whitespace/indent lost by RTE
Didn't manage to find RTE settings to avoid losing leading whitespace of
lines, so reindeint arch after doing all integration, right before saving back
to view's field.

* html.fromstring(parser=HTMLParser(remove_blank_text=True) does not seem to
  work, so serialize to XML, and parse back with
  remove_blank_text. remove_blank_text necessary for lxml's pretty_print to
  work correctly.

* pretty_print only & always uses 2 spaces/indent level. Our files (and the
  HTML editor's Format button) uses 4 spaces -> need a second pass to double
  indents.

bzr revid: xmo@openerp.com-20140227125934-q8j3z440px2ic6kx
2014-02-27 13:59:34 +01:00
Xavier Morel 4469b36f77 [FIX] change view section saving: only save view section *content*
Before, would save view section itself (including root element). But
branding distribution (and thus editability) are set on the last
programmatic root, thus the root element may well be generated
e.g. <span t-att-foo> will define the span itself as editable.

Saving this would remove the programmatic content on the node, and
thus break the view section altogether.

Fix the issue by only saving the root's content in the previous root.

bzr revid: xmo@openerp.com-20131217112034-nbxbg919cffv4w51
2013-12-17 12:20:34 +01:00
Xavier Morel eaef36c910 [FIX] move conversion code from ir.fields.converter into website.qweb structures
bzr revid: xmo@openerp.com-20131009133112-05dglhptiw019838
2013-10-09 15:31:12 +02:00
Xavier Morel 5de155ad98 [FIX] avoid losing non-meta attributes when converting t-fields back
bzr revid: xmo@openerp.com-20130919092546-c7yr8e4kixh4ngta
2013-09-19 11:25:46 +02:00
Xavier Morel 757a2dbc4e [IMP] single whole-page editor, reinstate ability to save only an embedded field (not part of a view)
bzr revid: xmo@openerp.com-20130917085753-aa32xxezhtrfaffj
2013-09-17 10:57:53 +02:00
Xavier Morel 29707bb8bf [FIX] don't lose text following a node being transformed back into a t-field
bzr revid: xmo@openerp.com-20130910143406-nuzu8vz5rzmshnzc
2013-09-10 16:34:06 +02:00
Xavier Morel 7e6f1a104e [ADD] move view.save tests from server
bzr revid: xmo@openerp.com-20130910133055-75q72gd75sty317m
2013-09-10 15:30:55 +02:00