@ones-editor/editor 0.0.9-beta.10 → 0.0.9-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -55114,7 +55114,16 @@ ${codeText}
55114
55114
  return root2;
55115
55115
  }
55116
55116
  function processedHtmlToDocByMarkdown(html, options) {
55117
- const markdown = turndownService.turndown(html);
55117
+ let htmlFragment = html;
55118
+ const metaTags = new DOMParser().parseFromString(html, "text/html").querySelectorAll("meta");
55119
+ if (metaTags.length && Array.from(metaTags).some((meta) => meta.getAttribute("content") === "PowerPoint.Slide")) {
55120
+ const start = html.indexOf("<!--StartFragment-->");
55121
+ const end = html.indexOf("<!--EndFragment-->");
55122
+ if (start !== -1 && end !== -1) {
55123
+ htmlFragment = html.substring(start + "<!--StartFragment-->".length, end);
55124
+ }
55125
+ }
55126
+ const markdown = turndownService.turndown(htmlFragment);
55118
55127
  return markdownToDoc(markdown, {
55119
55128
  htmlToDoc: (html2) => {
55120
55129
  const doc2 = htmlToDocByMarkdown(html2, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "0.0.9-beta.10",
3
+ "version": "0.0.9-beta.11",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",