#1242: Comments are not always stripped when compressing
------------------------------------+---------------------------------------
Reporter: fredck | Owner:
Type: Bug | Status: new
Priority: Normal | Milestone:
Component: Project : FCKpackager | Version:
Resolution: | Keywords: Confirmed Review?
------------------------------------+---------------------------------------
Changes (by fredck):
* keywords: Confirmed => Confirmed Review?
Comment:
The problem here is in the regex used to isolate and save strings and
regular expressions. It was not looking for the "*" char before "/" in the
regular expression start.
There is also a big problem with the division literal (/). In the
following example:
{{{
var a = 1 ; b = 1 ; g = 1 ;
var c = a / b / g ;
}}}
The processor was considering {{{/ b /}}} as a regular expression.
There would be possible to solve this problem, but PHP doesn't support
flexible length on lookbehind assertions. So, the patch also includes two
further assertions that impose some rules for regular expressions and
divisions:
* There must be a semicolon at the end of lines containing regular
expressions. It helps us avoiding the problem in the following line:
{{{
fs = Math.round( fs / 1.3333 ) + "pt"; // convert to points
}}}
* There must be a space after the division character. So, "(((a / b /
g)))" is considered a division. If instead we have "{{{a/b/g}}}",
"{{{/b/}}}" is considered a regular expression.
--
Ticket URL: <http://dev.fckeditor.net/ticket/1242#comment:2>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac