Is it possible to Keep Source Formatting for HTML contenteditable <div>?

Viewed 46

I couldn't find an answer anywhere I look into.

I have built a simple and personal WYSIWYG editor. But I don't know if there's a feature to add a Keep Source Formatting (very important for me).

I need to be able to copy all the formatting/styling from any website or source the text is copied from. This is like the feature from Word's Paste Options.

My work deals mostly with different state websites and PDFs. Most of the time for HTMLs, formatting will be copied without a problem. But problems occur for when copying texts from PDFs. They are almost never copied properly.

I am only using this customized tool since I added a lot of useful features that Word don't have.

Here's a PDF sample from a state website:

enter image description here [Source:https://uscode.house.gov/download/bills/116-1/116-90.pdf]

If I copy-paste those text, all the formatting will not be copied and it will combine them as one paragraph.

Here's another one:

enter image description here [Source:http://lawfilesext.leg.wa.gov/biennium/2019-20/Pdf/Bills/Session%20Laws/Senate/5954-S.sl.pdf]

The code I'm using for the contenteditable div is just a basic one:

<div contenteditable="true" class="editablediv" placeholder="Write something . . ." ></div>

0 Answers
Related