#1355: Converting <p> to <pre> may add additional line breaks
----------------------+-----------------------------------------------------
Reporter: fredck | Owner: martinkou
Type: Bug | Status: assigned
Priority: Normal | Milestone: FCKeditor 2.6
Component: General | Version: SVN
Resolution: | Keywords: Review-
----------------------+-----------------------------------------------------
Comment (by martinkou):
I've written a new patch based on the regex approach, with some simple
XHTML parsing logic to differentiate between XHTML tags and non-tag XHTML
code.
It turns out there are quite a number of gotchas in converting between
<pre> and regular blocks. e.g. when converting from <pre> to <p>... the
following cases need to be handled correctly:
{{{
<pre>some sample</pre>
}}}
vs
{{{
<pre>some sample</pre>
}}}
The first case can be converted to <p> without any problem. But the spaces
in the second case must be converted to .
and
{{{
<pre> some sample</pre>
}}}
vs
{{{
<pre>some sample</pre>
}}}
Simply changing the tag to <p> in the first case would cause the leading
space to disappear, so even though it's only a single space it still must
be converted to .
And then there are gotchas when people put weird stuff inside tags... e.g.
trying to convert the following to <pre>
{{{
<p>some <b attr="<< >>" attr2='> >< <'> text </b>
here</p>
}}}
Sure it's not standard but even if the user wrote > and < within
those quotes, IE would still convert them back to the literal form for us,
which causes trouble for regex substitutions since simple dumb regex does
not differentiate between text inside tags and text outside tags.
I think I should write some test cases in the FCKtest SVN tree first, to
record down all those gotchas I've discovered so far, before putting my
patch on review.
--
Ticket URL: <https://dev.fckeditor.net/ticket/1355#comment:8>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac