3
submitted 5 months ago* (last edited 5 months ago) by andrew_s@piefed.social to c/piefed_meta@piefed.social

Lemmy's spoiler format is

VISIBLE
HIDDEN 1
HIDDEN 2

As described here

The regex I've come up with is :{3} spoiler\s+?(\S.+?\n)(.+?)\n:{3}

It won't do spoilers inside spoilers, but that's a pretty niche case.

The changed code is viewable on GitHub

Any thoughts or suggestions for the regex before I create the PR?

I'm assuming that if I create a PR, and if they accept it, they'll (eventually) release a version with it in, and the line in pyfedi's requirements.txt can get version bumped. This seems like the 'proper' way to do it, but it's a bit long-winded, so maybe there's a better way to do it.

you are viewing a single comment's thread
view the rest of the comments
[-] andrew_s@piefed.social 1 points 5 months ago

I used Regex101 too (it works for me!)

this post was submitted on 01 Apr 2024
3 points (100.0% liked)

PieFed Meta

288 readers
2 users here now

Discuss PieFed project direction, provide feedback, ask questions, suggest improvements, and engage in conversations related to the platform organization, policies, features, and community dynamics.

Wiki

founded 8 months ago
MODERATORS