jodit
Version:
Jodit is awesome and usefully wysiwyg editor with filebrowser
16 lines (14 loc) • 437 B
text/typescript
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2020 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* Check if a string is html or not
*
* @method isHTML
* @param {string} str
* @return {boolean}
*/
export const isHTML = (str: string): boolean =>
/<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)<\/\1>/m.test(str);