Ckeditor4: Configuration flag forceSimpleAmpersand does not work

Created on 26 Sep 2017  路  7Comments  路  Source: ckeditor/ckeditor4

Are you reporting a feature request or a bug?

Bug

Check if the issue is already reported

https://dev.ckeditor.com/ticket/16746#no1
Previously reported in this ticket, but the steps to replicate were not correct. The documentation states that the forceSimpleAmpersand flag will _"force using & instead of & in element attributes values."_

(https://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-forceSimpleAmpersand)

Provide detailed reproduction steps (if any)

  1. Create a new editor with the forceSimpleAmpersand option set to true (https://codepen.io/anon/pen/gGmOmW?editors=1010)
  2. Switch to Source View
  3. Add an <a> tag with an href attribute that contains an ampersand ex: <a href="http://www.blah.com?foo=1&bar=2">Test link</a>
  4. Switch WYSIWYG View
  5. Switch back to Source View

Expected result

Anchor tag href property should remain the same:
<a href="http://www.blah.com?foo=1&bar=2">Test link</a>

Actual result

Anchor tag href property has the ampersand encoded
<a href="http://www.blah.com?foo=1&amp;bar=2">Test link</a>

Other details

  • Browser: Chrome Version 60.0.3112.113 (Official Build) (64-bit)
  • OS: MacOS
  • CKEditor version: 4.7.1
  • Installed CKEditor plugins: default plugins
good first issue regression confirmed minor bug

Most helpful comment

Ahh yes I can, I think I was in the middle of writing a unit test for it but was pulled away. I'll submit a PR in a few.

All 7 comments

The sad facts are some websites do not support the & amp; and expect only the & to be there. thus as is -- CKeditor breaks the URL. Who gives a damn about the specs -- CKEditor needs to fix this and let the users control what is needed and not force something that doesn't work (sometimes)

Looks like this problem was introduced with 4.5.0 - with 4.4.8 it works as expected.

@alexmaris your commit solves the problem (bug) for me. Cloud you make a pull request for this fix?

Ahh yes I can, I think I was in the middle of writing a unit test for it but was pulled away. I'll submit a PR in a few.

PR submitted, sorry for the delay!

The sad facts are some websites do not support the & amp; and expect only the & to be there. thus as is -- CKeditor breaks the URL. Who gives a damn about the specs -- CKEditor needs to fix this and let the users control what is needed and not force something that doesn't work (sometimes)

I wrote this several years ago, and today 6/24/20 it is still an issue. forceSimpleAmpersand does not work. CKeditor people,,you are not Google. We the users of your product wear big pants and can deal with backward compatibility. Will you get this fixed and stop hiding behind some outdated standards. I just spent hours on this today. I have better things to do with my life.

@mlandmann I see this issue was fixed some time ago in #2416 and #2418. However, if you still experiencing any problems with this configuration option please open a new issue describing your case and reproduction steps.

Was this page helpful?
0 / 5 - 0 ratings