discourse/app/assets/javascripts/pretty-text/engines/discourse-markdown/image-grid.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
394 B
JavaScript
Raw Normal View History

const gridRule = {
tag: "grid",
before(state) {
let token = state.push("bbcode_open", "div", 1);
token.attrs = [["class", "d-image-grid"]];
},
after(state) {
state.push("bbcode_close", "div", -1);
},
};
export function setup(helper) {
helper.allowList(["div.d-image-grid"]);
helper.registerPlugin((md) => {
md.block.bbcode.ruler.push("grid", gridRule);
});
}