mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 23:48:45 +08:00
20 lines
394 B
JavaScript
20 lines
394 B
JavaScript
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);
|
|
});
|
|
}
|