spliter-html

1.0.10 • Public • Published

spliter-html

library to split html elements in contentEditable

Result

from:

<div>
<img src="https://picsum.photos/200/300">
</div>

to:

<div></div>
<img src="https://picsum.photos/200/300">
<div></div>

Works for rich text editors

from:

<p>
<span style="font-size:14px">Feel free to open [issues on] Github.</span>
</p>

to:

<p>
<span style="font-size:14px">Feel free to open </span>
<span style="font-size:20px">issues on</span>
<span style="font-size:14px"> Github.</span>
</p>

How to use

spliterHtml(fromElement,toElement);
  • fromElement must be child of toElement.

Package Sidebar

Install

npm i spliter-html

Weekly Downloads

3

Version

1.0.10

License

MIT

Unpacked Size

66.8 kB

Total Files

9

Last publish

Collaborators

  • styleit