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; }; 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'); } }