feat(markdown): use BBCode-style [spoiler][/spoiler] tags

This commit is contained in:
plebeius
2026-03-06 20:54:11 +08:00
parent 0247a392c2
commit 91615dbf47
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ type Token =
| { type: 'crossBoardLink'; display: string; route: string }
| { type: 'spoiler'; tokens: Token[] };
const SPOILER_REGEX = /<spoiler>([\s\S]*?)<\/spoiler>/;
const SPOILER_REGEX = /\[spoiler\]([\s\S]*?)\[\/spoiler\]/;
const CROSSBOARD_REGEX = />>>\/((?:[a-zA-Z0-9]{1,10}\/(?:[a-zA-Z0-9]{46})?|[a-zA-Z0-9\-.]+(?:\/[a-zA-Z0-9]{46})?))[.,:;!?]*/;
const QUOTE_LINK_REGEX = /(?<![>/\w])>>(\d+)(?![\d/])/;
const URL_REGEX = /https?:\/\/[^\s<\[\]]*[^\s<\[\].,;:!?\"'\)\]>]/;