@[email protected] to Lemmy Bots and [email protected]English • edit-21 year agoRegex for lemmy spoilersmessage-square1fedilinkarrow-up15arrow-down10file-text
arrow-up15arrow-down1message-squareRegex for lemmy spoilers@[email protected] to Lemmy Bots and [email protected]English • edit-21 year agomessage-square1fedilinkfile-text
Through trial and errors, I’ve created regex for lemmy spoilers: /:::\sspoiler\s+(?<title>.+)\n(?<body>[\s\S]+?)\n:::/g link to regex101.com with explanation
minus-squarePerhytelinkEnglish2•edit-21 year agoYou need a $ at the end to ensure the final ::: is on a line by itself. For example: ::: spoiler Example Content ::: More content Additional content ::: is rendered as one big spoiler block: Example Content ::: More content Additional content even though it has a line starting with ::: in the middle.
You need a
$
at the end to ensure the final:::
is on a line by itself.For example:
is rendered as one big spoiler block:
Example
Content
::: More content
Additional content
even though it has a line starting with
:::
in the middle.