From 63aada7357e89c544b6b5cac1358b192cf73c6e3 Mon Sep 17 00:00:00 2001 From: Andrey Tikhonov <17@itishka.org> Date: Fri, 29 Dec 2023 11:46:53 +0100 Subject: [PATCH] blockquote support, /closes #25 --- example.html | 1 + src/sulguk/entities/decoration.py | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example.html b/example.html index 04572c6..3bba9d1 100644 --- a/example.html +++ b/example.html @@ -8,4 +8,5 @@

Lists and formatting are supported


Other features

+
This is block quote

This is paragraph!

And one more with quote.

\ No newline at end of file diff --git a/src/sulguk/entities/decoration.py b/src/sulguk/entities/decoration.py index 3065d02..339146d 100644 --- a/src/sulguk/entities/decoration.py +++ b/src/sulguk/entities/decoration.py @@ -76,14 +76,13 @@ def render(self, state: State) -> None: @dataclass -class Blockquote(Group): - block: bool = True +class Blockquote(DecoratedEntity): + language: Optional[str] = None - def render(self, state: State) -> None: - indent = state.canvas.indent - state.canvas.indent += 1 - super().render(state) - state.canvas.indent = indent + def _get_entity(self, offset: int, length: int) -> MessageEntity: + return MessageEntity( + type="blockquote", offset=offset, length=length, + ) @dataclass