mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-02 21:29:12 -04:00
HTML import: Replace cheerio with jsdom to simplify contentcollector
Cheerio provides jQuery-like objects but they wrap DOM Node-like objects that are not 100% API compatible with the DOM spec. Because of this, contentcollector, which is used in browsers and in Node.js during HTML import, has until now needed to support two different APIs. This commit modifies HTML import to use jsdom instead of cheerio and simplifies contentcollector.
This commit is contained in:
parent
84d6d277d7
commit
c816c20bc7
6 changed files with 330 additions and 215 deletions
19
CHANGELOG.md
19
CHANGELOG.md
|
@ -1,3 +1,22 @@
|
|||
# Next Release
|
||||
|
||||
### Compatibility changes
|
||||
|
||||
* For plugin authors:
|
||||
* Etherpad now uses [jsdom](https://github.com/jsdom/jsdom) instead of
|
||||
[cheerio](https://cheerio.js.org/) for processing HTML imports. There are
|
||||
two consequences of this change:
|
||||
* `require('ep_etherpad-lite/node_modules/cheerio')` no longer works. To
|
||||
fix, your plugin should directly depend on `cheerio` and do
|
||||
`require('cheerio')`.
|
||||
* The `node` context argument passed to the `collectContentImage` hook is
|
||||
now an
|
||||
[`HTMLImageElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement)
|
||||
object rather than a Cheerio Node-like object, so the API is slightly
|
||||
different. See
|
||||
[citizenos/ep_image_upload#49](https://github.com/citizenos/ep_image_upload/pull/49)
|
||||
for an example fix.
|
||||
|
||||
# 1.8.14
|
||||
|
||||
### Security fixes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue