feat: render embedded invoices (#392)
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
EMOJI_SHORT_CODE_REGEX,
|
||||
HASHTAG_REGEX,
|
||||
IMAGE_REGEX,
|
||||
LN_INVOICE_REGEX,
|
||||
URL_REGEX,
|
||||
VIDEO_REGEX,
|
||||
WS_URL_REGEX
|
||||
@@ -21,6 +22,7 @@ export type TEmbeddedNodeType =
|
||||
| 'websocket-url'
|
||||
| 'url'
|
||||
| 'emoji'
|
||||
| 'invoice'
|
||||
|
||||
export type TEmbeddedNode =
|
||||
| {
|
||||
@@ -79,6 +81,11 @@ export const EmbeddedEmojiParser: TContentParser = {
|
||||
regex: EMOJI_SHORT_CODE_REGEX
|
||||
}
|
||||
|
||||
export const EmbeddedLNInvoiceParser: TContentParser = {
|
||||
type: 'invoice',
|
||||
regex: LN_INVOICE_REGEX
|
||||
}
|
||||
|
||||
export function parseContent(content: string, parsers: TContentParser[]) {
|
||||
let nodes: TEmbeddedNode[] = [{ type: 'text', data: content.trim() }]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user