We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30269
    • 119 Posts
    IF I like to insert special HTML character, such as &#10003 - checkmark, CKEditor screws it up. There are some settings in CKEditor to accomodate this, but it seems I can not use them in MODx environment?
      • 39194
      • 149 Posts
      What do you mean when you say "screw"? CKEditor replace html entity with unicode character. Is it bad?
        • 30269
        • 119 Posts
        It does not replace with unicode... would be great if it did. Sadly it only showed a "?" when reloaded the page to edit.

        I failed when I tried to get it working by editing modx.htmleditor.js:

        htmlEncodeOutput: false,
        basicEntities : false,
        entities : false,
        forceSimpleAmpersand : true,
        


        ( I also commented out the " autocorrect" settings... that bothered at times )
        [ed. note: Tom last edited this post 11 years, 9 months ago.]
          • 39194
          • 149 Posts
          Quote from: Tom at Dec 02, 2014, 08:03 AM
          It does not replace with unicode... would be great if it did. Sadly it only showed a
          ( I also commented out the " autocorrect" settings... that bothered at times )

          Could you please clarify what bothered you? By the way, next release will have a button, allowing to disable or configure AutoCorrect.
            • 30269
            • 119 Posts
            Thanks Danya for reply.

            In the manager, CKEditor, I try to insert "✔" in a webpage. However, when I navigate away from that page, do something else in the manager and then come back to edit same page again, CKEditor replaced the "✔" with a "?". Also in the website it shows a "?"
              • 39194
              • 149 Posts
              I guess you use wrong charset for database connection. You can disable CKEditor, paste ✔ into plain textarea and try to save it.
              Could you please explain what's wrong with autocorrect?
                • 30269
                • 119 Posts
                Autocorrect: example the double quotes: sometimes I want " " and not ,, " But.. I guess I am just now sensitive to get jsut one checkmark to show up. I am about to use an image... pff))

                I dont' think it is in the database: the webpage shows sometimes a "✔". Only after returning with CK to the page it fails. Keeping all in Source mode, so non-RTE makes all ok. The "✔" even shows correctly in the source of the page.
                  • 30269
                  • 119 Posts
                  I "solved" the CK configuration bug, by including some pre-parsing of each page. Whereever I fill a table cell with a "V" or a "X", it will replace the cell with a checkmark. Dirty but it works:


                  $("table").each( function() { 
                  		$(this).textReplace("<td>V</td>","<td>✓</td>");
                  		$(this).textReplace("<td>X</td>","<td>✗</td>");
                  	});
                  
                  // Replace occurrence of one text with other in the element
                  
                  $.fn.textReplace = function(target, replacement) {
                  	var regex = new RegExp( target, "igm");
                      this.html(this.html().replace(regex, replacement));
                      return this;
                  }
                  [ed. note: Tom last edited this post 11 years, 9 months ago.]
                    • 30269
                    • 119 Posts
                    Some additional feedback about Autocorrect (should we nog have seperate discussion for this?):

                    • In our language (Dutch) we write often 's for example "scenario's". I find myself a lot pressing Ctrl-Z to correct the false assumption I want something else.
                    • And why does system write "<<" when I type " ? also weird.
                      • 39194
                      • 149 Posts
                      Quote from: Tom at Dec 04, 2014, 07:32 AM
                      And why does system write "<<" when I type " ? also weird.[
                      This is not "<<" smiley It's «French quotation marks», used in Russian texts (sorry, this is in default configuration because most package users (and me) are from Russia).

                      Tom, first of all, you can configure quotes in CKEditor settings (System settings, 'ckeditor' namespace).
                      Set double_quotes to „” and singe_quotes to ‚’ (looks like there are used in your language).

                      You can also configure AutoCorrect options (by pressing AutoCorrect button in CKEditor toolbar) and disable auto quotation.