Skip to content

Commit

Permalink
blockquote support, /closes #25
Browse files Browse the repository at this point in the history
  • Loading branch information
Tishka17 committed Dec 29, 2023
1 parent 0bcbe82 commit 63aada7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ <h3>Lists and formatting are supported</h3>
</ol>
<hr />
<h3>Other features</h3>
<Blockquote>This is block quote</Blockquote>
<p>This is paragraph!</p><p>And one more with <q>quote</q>.</p>
13 changes: 6 additions & 7 deletions src/sulguk/entities/decoration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63aada7

Please sign in to comment.