import { toLatestFormat } from "./toLatestFormat.js";
const permissivelyDeserializeNodes = (editor, serializedElement, errorMessage) => {
  let deserialized = null;
  try {
    deserialized = JSON.parse(serializedElement);
  } catch (e) {
  }
  if (typeof deserialized !== "object" || deserialized === null) {
    return [editor.createDefaultElement([{ text: serializedElement }])];
  }
  if ("formatVersion" in deserialized) {
    return toLatestFormat(editor, deserialized).children;
  }
  return toLatestFormat(editor, {
    formatVersion: 0,
    children: [deserialized]
  }).children;
};
export { permissivelyDeserializeNodes };
//# sourceMappingURL=permissivelyDeserializeNodes.js.map
