@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
21 lines (20 loc) • 866 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createADFFromHTML = void 0;
var _parseHtmlTextContent = require("./parse-html-text-content");
/**
* Creates ADF from HTML string.
* This is particularly useful for providing translations in HTML to be supported and we convert back to ADF here
* See: https://developer.atlassian.com/platform/localization/i18n-formatting/avoiding-concatenation/
*
* This function only supports a subset of the schema as it is intended for translations, but it supports
* SSR as it has no DOM dependencies and is lightweight.
*
* @param html - The HTML string to convert to ADF
* @returns ADF DocNode or undefined if parsing fails
*/
var createADFFromHTML = exports.createADFFromHTML = function createADFFromHTML(html) {
return (0, _parseHtmlTextContent.parseHTMLTextContent)(html);
};