MCPcopy
hub / github.com/codex-team/editor.js / isHTMLString

Method isHTMLString

src/components/dom.ts:430–436  ·  view source on GitHub ↗

* Check if string contains html elements * * @param {string} str - string to check * @returns {boolean}

(str: string)

Source from the content-addressed store, hash-verified

428 * @returns {boolean}
429 */
430 public static isHTMLString(str: string): boolean {
431 const wrapper = Dom.make('div');
432
433 wrapper.innerHTML = str;
434
435 return wrapper.childElementCount > 0;
436 }
437
438 /**
439 * Return length of node`s text content

Callers 1

processDataTransferMethod · 0.80

Calls 1

makeMethod · 0.45

Tested by

no test coverage detected