diff --git a/dist/embed/iframe.html b/dist/embed/iframe.html
index cefb4d9a9c..71ec029660 100644
--- a/dist/embed/iframe.html
+++ b/dist/embed/iframe.html
@@ -189,6 +189,8 @@
if (cachedHtml !== html) {
root.html(html);
cachedHtml = html;
+
+ renderLinks();
};
};
@@ -244,6 +246,8 @@
};
root.html(data.div);
+
+ renderLinks();
resize();
}
});
@@ -261,14 +265,18 @@
success: (data) => {
root.html(data);
- root.find('a').off('click').on('click', function (e) {
- e.preventDefault();
- window.parent.postMessage({ type: 'openUrl', url: $(this).attr('href'), blockId }, '*');
- });
+ renderLinks();
}
});
};
+ function renderLinks () {
+ root.find('a').off('click').on('click', function (e) {
+ e.preventDefault();
+ window.parent.postMessage({ type: 'openUrl', url: $(this).attr('href'), blockId }, '*');
+ });
+ };
+
function getEnvironmentContent (processor) {
const libs = [];
diff --git a/src/ts/component/block/embed.tsx b/src/ts/component/block/embed.tsx
index bb8030e8a2..e93f7737fc 100644
--- a/src/ts/component/block/embed.tsx
+++ b/src/ts/component/block/embed.tsx
@@ -615,7 +615,7 @@ const BlockEmbed = observer(class BlockEmbed extends React.Component {
const iw = (iframe[0] as HTMLIFrameElement).contentWindow;
const sanitizeParam: any = {
- ADD_TAGS: [ 'iframe' ],
+ ADD_TAGS: [ 'iframe', 'div', 'a' ],
ADD_ATTR: [
'frameborder', 'title', 'allow', 'allowfullscreen', 'loading', 'referrerpolicy',
],
@@ -669,6 +669,8 @@ const BlockEmbed = observer(class BlockEmbed extends React.Component]*/);
};
@@ -680,7 +682,7 @@ const BlockEmbed = observer(class BlockEmbed extends React.Component`;
+ return content.match(/^