Skip to content

Commit 8691786

Browse files
committed
Add default HTML converter for horizontal lines
1 parent 9c03902 commit 8691786

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mautrix/util/formatter/parser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ async def blockquote_to_fstring(self, node: HTMLNode, ctx: RecursionContext) ->
106106
msg = await self.tag_aware_parse_node(node, ctx)
107107
return msg.format(self.e.BLOCKQUOTE)
108108

109+
async def hr_to_fstring(self, node: HTMLNode, ctx: RecursionContext) -> T:
110+
return self.fs("---")
111+
109112
async def header_to_fstring(self, node: HTMLNode, ctx: RecursionContext) -> T:
110113
children = await self.node_to_fstrings(node, ctx)
111114
length = int(node.tag[1])
@@ -194,6 +197,8 @@ async def node_to_fstring(self, node: HTMLNode, ctx: RecursionContext) -> T:
194197
return self.fs("")
195198
elif node.tag == "blockquote":
196199
return await self.blockquote_to_fstring(node, ctx)
200+
elif node.tag == "hr":
201+
return await self.hr_to_fstring(node, ctx)
197202
elif node.tag == "ol":
198203
return await self.list_to_fstring(node, ctx)
199204
elif node.tag == "ul":

0 commit comments

Comments
 (0)