#3472: Reformatting breaks diff, <![CDATA[, inline XML
---------------------+------------------------------------------------------
Reporter: whitis | Owner:
Type: Bug | Status: new
Priority: High | Milestone:
Component: General | Version:
Keywords: |
---------------------+------------------------------------------------------
I typed some sample text into your demo to see if it would do something
vaguely resembling the right thing with inline XML. Not only did it not
do the right thing, it revealed an enormous bug.
Typed in source mode:
{{{
<p>This is some <strong>sample text</strong>. You are using <a
href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<myxml xmlns="http://www.example.com/foo/bar/baz">
<myxml2>foo</myxml2>
<myxml3>foo</myxml3>
</myxml>
}}}
After switching to WYSIWYG mode and back to source mode, this had been
badly mangled:
<p>This is some <strong>sample text</strong>. You are using <a
href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<p><myxml> <myxml2>foo</myxml2> <myxml3>foo</myxml3>
</myxml></p>
Mangling:
- Insertion of p tag
- deletion of xmlns attribute
- reformatting
Reformatting is absolutely unacceptable. Here is why: diff/patch, cvs,
subversion, git, mercurial, arch, ...
It also breaks conflict resolution on a wiki.
NEVER reformat without explicit instructions to do so. The only text you
can reformat is what someone edits and then keep as close to the original
format as possible.
For tags you don't recognize, display the source for the duration of the
tag and body.
Consider, also, what your mangling would do to something like this:
{{{
<microcontroller_table_entry xmlns="...">
<product>
<manufacturer>NXP</manufacturer>
<part_no>XX123</part_no>
</product>
<core>
<cpu>ARM7TDMI</cpu>
<bits>32</bits>
</core>
<memory>
<flash>256KB</flash>
<ram>64KB</ram>
</memory>
<buses>
<usb>Yes</usb>
</buses>
</microcontroller_table_entry>
}}}
In its original form it is human readable/editable. In this format, it is
not:
<p><microcontroller_table_entry>
<product> <manufacturer>NXP</manufacturer>
<part_no>XX123</part_no>
</product>
<core> <cpu>ARM7TDMI</cpu> <bits>32</bits>
</core> <memory> <flash>256KB</flash>
<ram>64KB</ram> </memory> <buses> <usb>Yes</usb>
</buses> </microcontroller_table_entry></p>
Of, course, there is the security/conformance issue of unrecognized tags.
In the real world, these would need to be stripped where not explicitly
allowed. They shouldn't be stripped without notifying user first as this
could result in considerable loss of work.
As another test, I used a plain XHTML file:
http://www.freelabs.com/~whitis/linux/usb_ubuntu_9.04RC/index.xhtml
The file was badly mangled to the point where it was completely
unrecognizable to diff. In addition to the mangling, there was
another bug. In one place:
]]></code></pre>
which was the end of a <![CDATA[ section was displayed as "]]>" in WYSIWIG
mode and the following text formated improperly.
Test this program with real web pages and diff.
--
Ticket URL: <http://dev.fckeditor.net/ticket/3472>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac