Skip to content

Commit

Permalink
fix: update serialisers to support blockquote entities
Browse files Browse the repository at this point in the history
  • Loading branch information
dcdunkan committed Feb 14, 2024
1 parent 85f1e6c commit 6705a17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions serialisers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const HTML: Serialiser = (match: string, node?: Node) => {
return `<a href="${node.url}">${match}</a>`;
case "text_mention":
return `<a href="tg://user?id=${node.user.id}">${match}</a>`;
case "blockquote":
return `<blockquote>${match}</blockquote>`;
case "mention":
case "custom_emoji":
case "hashtag":
Expand Down Expand Up @@ -58,6 +60,8 @@ export function MarkdownV2(match: string, node?: Node): string {
return `[${match}](${node.url})`;
case "text_mention":
return `[${match}](tg://user?id=${node.user.id})`;
case "blockquote":
return `${match.split("\n").map((line) => `>${line}`).join("\n")}`;
case "mention":
case "custom_emoji":
case "hashtag":
Expand Down

0 comments on commit 6705a17

Please sign in to comment.