mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 12:03:43 +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);
|
|
});
|
|
}
|