diff --git a/assets/bundled/bbcode-parser.min.js b/assets/bundled/bbcode-parser.min.js index 3db1ee9..1e8dcf6 100644 --- a/assets/bundled/bbcode-parser.min.js +++ b/assets/bundled/bbcode-parser.min.js @@ -318,6 +318,12 @@ } return toNode("span", { style: `color: ${inputColor}` }, node.content); }; + + const comment = (node) => { + return toNode( + "span", {class: "hidden" }, node.content, + ); + }; const divide = (node) => { const type = (preprocessAttr(node.attrs)._default || "").toLowerCase(); @@ -1483,6 +1489,7 @@ check, code, color, + comment, divide, fieldset, font, diff --git a/bbcode-src/preset.js b/bbcode-src/preset.js index ba8b9b4..638c820 100644 --- a/bbcode-src/preset.js +++ b/bbcode-src/preset.js @@ -9,6 +9,7 @@ import { centerblock } from "./tags/centerblock"; import { check } from "./tags/check"; import { code, icode, savenl } from "./tags/code"; import { color } from "./tags/color"; +import { comment } from "./tags/comment"; import { divide } from "./tags/divide"; import { fieldset } from "./tags/fieldset"; import { font } from "./tags/font"; @@ -50,6 +51,7 @@ const tags = { check, code, color, + comment, divide, fieldset, font, diff --git a/bbcode-src/tags/comment.js b/bbcode-src/tags/comment.js new file mode 100644 index 0000000..1bf25e8 --- /dev/null +++ b/bbcode-src/tags/comment.js @@ -0,0 +1,14 @@ +import { toNode } from "../utils/common"; + +/** + * @file Adds [comment] tag + * @example [comment]Content[/comment] + */ + +const comment = (node) => { + return toNode( + "span", {class: "hidden" }, node.content, + ); +}; + +export { comment }; \ No newline at end of file