From e8cd784b7279e49eb0c975ba8a135c2435e87a83 Mon Sep 17 00:00:00 2001 From: vladkrk Date: Mon, 17 Mar 2025 12:21:35 +0300 Subject: [PATCH 1/3] fix: upgrade html-extension peer-dep to support setupRuntimeConfig --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index a9721fb83..50ff28fd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -126,7 +126,7 @@ "@diplodoc/cut-extension": "^0.5.0 || ^0.6.1 || ^0.7.1", "@diplodoc/file-extension": "^0.2.1", "@diplodoc/folding-headings-extension": "^0.1.0", - "@diplodoc/html-extension": "^2.3.2", + "@diplodoc/html-extension": "^2.7.1", "@diplodoc/latex-extension": "^1.0.3", "@diplodoc/mermaid-extension": "^1.0.0", "@diplodoc/tabs-extension": "^3.5.1", diff --git a/package.json b/package.json index bdab45312..250309a5d 100644 --- a/package.json +++ b/package.json @@ -308,7 +308,7 @@ "@diplodoc/cut-extension": "^0.5.0 || ^0.6.1 || ^0.7.1", "@diplodoc/file-extension": "^0.2.1", "@diplodoc/folding-headings-extension": "^0.1.0", - "@diplodoc/html-extension": "^2.3.2", + "@diplodoc/html-extension": "^2.7.1", "@diplodoc/latex-extension": "^1.0.3", "@diplodoc/mermaid-extension": "^1.0.0", "@diplodoc/tabs-extension": "^3.5.1", From 310f7ad024ef7036327d6f93cd0b4cd426ec3eb0 Mon Sep 17 00:00:00 2001 From: vladkrk Date: Mon, 17 Mar 2025 12:47:09 +0300 Subject: [PATCH 2/3] fix: add setupRuntimeConfig optional chain because of old html-extension peers --- package-lock.json | 2 +- package.json | 2 +- src/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.ts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 50ff28fd9..a9721fb83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -126,7 +126,7 @@ "@diplodoc/cut-extension": "^0.5.0 || ^0.6.1 || ^0.7.1", "@diplodoc/file-extension": "^0.2.1", "@diplodoc/folding-headings-extension": "^0.1.0", - "@diplodoc/html-extension": "^2.7.1", + "@diplodoc/html-extension": "^2.3.2", "@diplodoc/latex-extension": "^1.0.3", "@diplodoc/mermaid-extension": "^1.0.0", "@diplodoc/tabs-extension": "^3.5.1", diff --git a/package.json b/package.json index 250309a5d..bdab45312 100644 --- a/package.json +++ b/package.json @@ -308,7 +308,7 @@ "@diplodoc/cut-extension": "^0.5.0 || ^0.6.1 || ^0.7.1", "@diplodoc/file-extension": "^0.2.1", "@diplodoc/folding-headings-extension": "^0.1.0", - "@diplodoc/html-extension": "^2.7.1", + "@diplodoc/html-extension": "^2.3.2", "@diplodoc/latex-extension": "^1.0.3", "@diplodoc/mermaid-extension": "^1.0.0", "@diplodoc/tabs-extension": "^3.5.1", diff --git a/src/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.ts b/src/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.ts index c849b660a..3353fa53a 100644 --- a/src/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.ts +++ b/src/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.ts @@ -10,7 +10,8 @@ export function useYfmHtmlBlockRuntime( htmlRuntimeConfig: HTMLRuntimeConfig = {}, ) { if (meta?.script?.includes(runtime)) { - setupRuntimeConfig(htmlRuntimeConfig); + // MAJOR: update html-extension peer on ^2.7.1 and remove optional chain + setupRuntimeConfig?.(htmlRuntimeConfig); import(/* webpackChunkName: "yfm-html-runtime" */ '@diplodoc/html-extension/runtime'); } } From 329d4ad91abae2dacd9170bc07f5d65afc7f22ba Mon Sep 17 00:00:00 2001 From: vladkrk Date: Mon, 17 Mar 2025 14:22:13 +0300 Subject: [PATCH 3/3] fix: add htmlRuntimeConfig info about html-extension version --- src/view/hocs/withYfmHtml/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/view/hocs/withYfmHtml/index.tsx b/src/view/hocs/withYfmHtml/index.tsx index c7ca29d50..3e9f4320c 100644 --- a/src/view/hocs/withYfmHtml/index.tsx +++ b/src/view/hocs/withYfmHtml/index.tsx @@ -15,6 +15,7 @@ export type WithYfmHtmlBlockOptions = { export type WithYfmHtmlBlockProps = { meta: TransformMeta; yfmHtmlBlockConfig?: IHTMLIFrameElementConfig; + /** Works only with html-extension dep version 2.7.1 and higher */ htmlRuntimeConfig?: HTMLRuntimeConfig; };