this post was submitted on 06 Dec 2023
1 points (100.0% liked)

Testing

46 readers
1 users here now

This is the sidebar for this community.

Testing badge markdown

Generic SVG

founded 1 year ago
MODERATORS
 

The following syntaxes work as expected (they create one spoiler tag).

The general rule here is that we allow 0-3 whitespaces before the starting colon, 3 or more colons, any number of optional whitespaces, and the "spoiler" keyword with any non-whitespace character after it.

Normal

spoilerHello!

spoilerHello!


No whitespace

spoiler with no whitespaceHello!

spoiler with no whitespaceHello!


Leading whitespace

   
titleHello!

titleHello!


Any number of whitespaces between : and "spoiler"

:::              spoiler title
Hello!
:::

::: spoiler title Hello! :::


Any number of whitespaces between "spoiler" and the first non-whitespace character

titleHello!

titleHello!


Three or more colons

::::::::::::::::::::::::              spoiler title
Hello!
::::::::::::::::::::::::

:::::::::::::::::::::::: spoiler title Hello! ::::::::::::::::::::::::



Here's where we run into some weird edge cases:

If there is an ending :::, Lemmy will consume the first instance of ::: only if ::: is on a new line with no other text (and up to 3 white spaces)

atext (no whitespaces before
) :::

atext (no whitespaces before
) :::


atext (1 whitespaces before
) :::

atext (1 whitespaces before
) :::


atext (2 whitespaces before
) :::

atext (2 whitespaces before
) :::


atext (3 whitespaces before
) :::

atext (3 whitespaces before
) :::


atext (4 whitespaces before
) :::

atext (4 whitespaces before
) :::



Lemmy doesn't need an ::: ending in order to display the spoiler. If ::: is not present, it will assume the spoiler continues until the end:

a
 spoiler a
text


Lemmy will create nested spoilers if it cannot find ::: before another ::: spoiler:

atext
spoiler b more text

atext
spoiler b more text :::



The following examples will show the ::: within the spoiler, and will make the spoilers nested

atext (4 whitespaces before
) :::

atext (4 whitespaces before
) :::


atext

atext


atext

atext


atext a

atext a

top 16 comments
sorted by: hot top controversial new old
[–] darklightxi@lemmy.ca 1 points 7 months ago

Testing reply to post again

[–] darklightxi@lemmy.ca 1 points 7 months ago* (last edited 7 months ago) (1 children)

Testing reply to post from action edit

[–] darklightxi@lemmy.ca 1 points 7 months ago* (last edited 7 months ago)

Testing reply to comment from long press edit

[–] darklightxi@lemmy.ca 1 points 7 months ago

Testing reply to post from fab

[–] firelightxi@lemmy.ml 1 points 7 months ago (2 children)
[–] darklightxi@lemmy.ca 1 points 7 months ago

Testing reply from inbox replies page using swipe gesture

[–] darklightxi@lemmy.ca 1 points 7 months ago* (last edited 7 months ago)

Testing reply when navigating to post from inbox replies page

Edit: testing editing comment from account page again and again

[–] darklightxi@lemmy.ca 1 points 7 months ago (1 children)
[–] darklightxi@lemmy.ca 1 points 7 months ago* (last edited 7 months ago)
[–] darklightxi@lemmy.ca 1 points 7 months ago (4 children)

Testing reply from post FAB action

[–] darklightxi@lemmy.ca 1 points 7 months ago

Testing reply to comment from long press action

[–] darklightxi@lemmy.ca 1 points 7 months ago

Testing reply from long press

[–] darklightxi@lemmy.ca 1 points 7 months ago

Testing reply from long pressssss

[–] darklightxi@lemmy.ca 1 points 7 months ago

Testing reply from long press again

[–] darklightxi@lemmy.ca 1 points 7 months ago* (last edited 7 months ago)
testtest
-

::: spoiler
test :::

hello

[–] darklightxi@lemmy.ca 1 points 7 months ago* (last edited 7 months ago)

Test^hello^


Test~hello~


Testing a really long piece of text with some superscript present on the next line^here^


Testing a really long piece of text with some subscript present on the next line~here~


This is a text^superscript^ and this is a text~subscript~


This is text with a subscript~hello~ followed by another text which contains a superscript^hello^ in the same paragraph.