Skip to content

Commit

Permalink
Merge pull request #110 from RpNation/bb-comment
Browse files Browse the repository at this point in the history
BBCode Tag: Comments #95
  • Loading branch information
kyuukestu authored May 7, 2024
2 parents 5539c39 + 51b4546 commit 466d457
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/bundled/bbcode-parser.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -1483,6 +1489,7 @@
check,
code,
color,
comment,
divide,
fieldset,
font,
Expand Down
2 changes: 2 additions & 0 deletions bbcode-src/preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -50,6 +51,7 @@ const tags = {
check,
code,
color,
comment,
divide,
fieldset,
font,
Expand Down
14 changes: 14 additions & 0 deletions bbcode-src/tags/comment.js
Original file line number Diff line number Diff line change
@@ -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 };

0 comments on commit 466d457

Please sign in to comment.