ckeditor / ckbuilder

The development repository of CKBuilder, a command line builder for CKEditor 4.
Other
19 stars 11 forks source link

Ampersand gets encoded in ku.js file on Windows #14

Closed mlewand closed 8 years ago

mlewand commented 8 years ago

There is a failing test on Windows in "Testing minification..." group, that produces following failure:

FAILED: minification[ku.js]
  Expected: CKEDITOR.plugins.setLang("about","ku",{copy:"???? ?????????????? © $1. ???? ?????????.",dlgTitle:"???????? CKEditor",help:"????? $1 ??? ?? ???????.",moreInfo:"?? ??????? ?????? ?????, ????? ??????? ???????????? ???:",title:"???????? CKEditor",userGuide:"??????????? CKEditors"});
  Actual  : CKEDITOR.plugins.setLang("about","ku",{copy:"???? ?????????????? \x26copy; $1. ???? ?????????.",dlgTitle:"???????? CKEditor",help:"????? $1 ??? ?? ???????.",moreInfo:"?? ??????? ?????? ?????, ????? ??????? ???????????? ???:",title:"???????? CKEditor",userGuide:"??????????? CKEditors"});

The problem is that it encodes: © into \x26copy;.

This has been experienced with Windows 7, by running tests with test.bat, Java version at 1.8.0_51, Java SE RE 1.8.0_51-b16.

mlewand commented 8 years ago

As far as I can see it encodes couple of HTML special chars: &, <, >. No quotes though.

mlewand commented 8 years ago

It seems that including new GCC version in 27b795c432c6dee3f5f31f3fbfe003e9a0be5ed0 caused this bug. Then again, it won't be reproducible until 84f160d8af7d8c042fc8ff43262dd772fd9209d6 which is where deprecated class name was replaced.

Tade0 commented 8 years ago

It seems that this behaviour is not configurable. I think we can live with this, since from JS's perspective & and \x26 within a string are the same thing.

mlewand commented 8 years ago

Couldn't find anything with quick googling either. The only place where one could find some reliable docs on Google Closure Compiler is their own repository. However this project structure is unreachable in a reasonable amount of time.

I can see at least one problem here, it makes impossible to put entities into language files, just because ampersand will get escaped with this escape sequence. This would e.g. break our "about" plugin (it uses &copy; entity in its dialog). However it gets inlined correctly into "ckeditor/lang/ku.js" file, at least it did for me in 4.5.8 build.

Ok, according to @Tade0 research it doesn't cause problems with entities as I described in comment above, therefore it's much safer for us.