Jump to content

CKEditor Clipboard Pasting


dreerr
 Share

Recommended Posts

Dear all,

I have a use case where there are big amounts of texts semi-manually imported from InDesign, the process is that .indd documents are converted to .html and then chunks of the text are copy & pasted into various fields in Processwire. I'm using a CKEditor field for this and I'm stuck as all classes are stripped from the pasted content.

<p class="Lauftext">
    Lorem ipsum dolor sit amet, <span class="Bold-Italic">consetetur sadipscing elitr,</span>
  sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, 
  sed diam voluptua.<span class="Superscript">1</span>
</p>

 

as I have turned off ACF and HTML Purifier still all classes in the p and span tags are stripped. Any idea how to solve this? Tried in Chrome and Safari.

Link to comment
Share on other sites

You might want to look into that Extra Allowed Content setting in your textarea field.

1735642194_2019-01-2515_20_49.png.1ba39d480d6284276bc3d8602c9d6ead.png

You can change settings accordingly to the CKEditor docs.

So something like this could already do the trick:

// from the docs
// A rule accepting <p> and <h1> elements with all their attributes.
p h1[*]
  
// change it to
p h1 h2 h3 h4 h5 h6 ul ol li img[*]

 

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...