From 172401092bc5bb1ec309031f9b61e72e47e52961 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Sun, 22 Sep 2024 20:07:01 +0200 Subject: updated spoiler and doc --- spoiler.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/spoiler.py b/spoiler.py index ee15dfd..ff762ef 100644 --- a/spoiler.py +++ b/spoiler.py @@ -1,12 +1,11 @@ """ -Encapsulates text in a
html tag with the class "quote" and between two paragraphs which contain a quote ("). -These all can be styled in css. +Creates a that contains a checkbox with a label that has a content and another that is a number of rectangle +characters (▉) equal to the content. A clickable spoiler/hidden text can be made with these when correctly styled. -Usage (without the backslashes): -\"""my quote\""" -or -\"""my quote "" source \""" +Usage: +||unique_id||content|| """ +from html import unescape from marko import inline from marko.helpers import MarkoExtension @@ -26,7 +25,7 @@ class SpoilerElement(inline.InlineElement): class SpoilerRenderer: def render_spoiler_element(self, element: SpoilerElement): content = self.render_children(element) - return f'' + return f'' Spoiler = MarkoExtension( -- cgit v1.2.3-70-g09d2