1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-21 09:22:09 +03:00

Added support for iframe node blocks

This commit is contained in:
Dan Brown
2022-01-20 13:38:16 +00:00
parent b1f5495a7f
commit 20f37292a1
7 changed files with 149 additions and 1 deletions

View File

@ -196,6 +196,27 @@ const image = {
}
};
const iframe = {
attrs: {
src: {},
height: {default: null},
width: {default: null},
title: {default: null},
allow: {default: null},
sandbox: {default: null},
},
group: "block",
draggable: true,
parseDOM: [{
tag: "iframe",
getAttrs: domAttrsToAttrsParser(["src", "width", "height", "title", "allow", "sandbox"]),
}],
toDOM(node) {
const attrs = extractAttrsForDom(node, ["src", "width", "height", "title", "allow", "sandbox"])
return ["iframe", attrs];
}
};
const hard_break = {
inline: true,
group: "inline",
@ -270,6 +291,7 @@ const nodes = {
code_block,
text,
image,
iframe,
hard_break,
callout,
ordered_list,