On Wed, Sep 7, 2016 at 8:53 AM, Paul Libbrecht <paul(a)hoplahup.net> wrote:
Marius Dumitru Florea wrote:
TBH I
don't remember exactly why we introduced the HTML Cleaner but we
> probably had issues at some point. Anyone remembers?
The main reason for me
is because we don't want simple users to break the
XWiki page layout when they copy & paste HTML from the web: "I pasted
this
content, saved and now the edit button
doesn't work anymore..". As
Vincent
said, the HTML macro is not intended only for
developers. So I'm -0,
close
to -1.
Can such a breakage really happen?
Doesn't the editor's
"back-from-html" already do the cleaning anyways?
Which editor? And WDYM by "back-from-html"?
The WYSIWYG editor doesn't clean the macro content: what you type in the
macro content text area (macro wizard) when you edit a macro from the
WYSIWYG edit mode is saved exactly as it is. Don't confuse this with
pasting content in the WYSIWYG editor's rich text area. That is cleaned but
it doesn't end up as HTML macro. I was referring strictly to pasting HTML
code inside the {{html}} macro using either the Wiki edit mode or WYSIWYG
editor's source text area / macro wizard.
Note that the WYSIWYG editor can easily be broken if the input HTML is not
valid, which is the case if the HTML macro doesn't clean its content. For
instance the editor relies on some XML comments (macro markers) to detect
the macros. When the browser tries to fix invalid HTML these XML comments
can be moved to the wrong place, thus breaking macro support in the WYSIWYG
editor. As a result the editor doesn't protect the macro output (read-only)
and so the editor ends up saving the macro output which is wrong.
Thanks,
Marius
Users that input html using the html macro in the menu
or using the wiki
editor appear to be a responsible category of users.
Paul
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs