Changeset 32057 for main/trunk

Show
Ignore:
Timestamp:
30.10.2017 18:41:26 (2 years ago)
Author:
ak19
Message:

There was a problem about attributes like align=justify going missing from <p> html elements in doc.xml after a user edits a document. I had been thinking it was an XSLT issue, but Kathy found that the CKEditor was the culprit. Reading up, it seems the CKEditor has an Advanced Content Filter (ACF) mode, which is set to automatic by default and which deletes disallowed elements and other things. I've now adjusted the CKEditor config to to turn off the automatic ACF, so it will the HTML elelements in doc.xml as is if the user didn't make the edit.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/ckeditor/config.js

    r30309 r32057  
    1010    // config.language = 'fr'; 
    1111    // config.uiColor = '#AADC6E'; 
     12 
     13    // Stop CKEditor from removing the attributes from HTML elements in doc.xml 
     14    // e.g. <P ALIGN="JUSTIFY"></P> in the original doc.xml gets turned into 
     15    // <p></p> when viewing the doc in editing mode and then, this ends up 
     16    // getting saved with user changes upon SaveAndRebuild. 
     17    // http://nightly.ckeditor.com/17-10-29-07-04/full/samples/old/datafiltering.html 
     18    // https://sdk.ckeditor.com/samples/acf.html 
     19    // https://stackoverflow.com/questions/15659390/ckeditor-automatically-strips-classes-from-div 
     20    // The following stops CKEDITOR from meddling with existing HTML: 
     21    config.allowedContent = true; 
    1222};