Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-15890

Prevent tinymce's html cleaner from cleaning up picker attributes

    XMLWordPrintable

Details

    • Task
    • Status: New
    • Top
    • Resolution: Unresolved
    • None
    • None
    • None
    • 5
    • Orion
    • BrXM Backlog
    • Undetermined

    Description

      TinyMCE post processes 'a' and 'img' html elements, removing or altering custom attributes that we use for the pickers. It does that in 2 occasions:

      • On content insertion. That is, when you're working in a rich text field and have selected a document/image via the link/image pickers and you press ok
      • On loading of the content (when opening the document for editing)

      I've added 2 methods that reconfigure the cleaner: 
      enablePickerAnchorAttributes and enablePickerImgAttributes. They register our custom attributes for the 'a' and 'img' elements into tinymce's cleaner rules so they are preserved.
       
      This tickets is about fixing 2 issues: # For the link picker we must set the attribute 'href' to the value 'http://'. But tinymce is changing this to 'http://localhost' 

      1. When loading content, our re-confifguration hasn't occurred yet. Tinymce strips the 'a' and 'img' elements of their 'href' and 'src' attributes respectively; these are required attrs for the pickers to work.

       
      Result is that we can pick a document/image and insert it in a rich text field, but after saving the document and reloading it they disappear.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mchatzidakis Minos Chatzidakis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: