Added missing html-tags for parsing

This commit is contained in:
morethanwords 2022-01-15 06:47:43 +04:00
parent 0b1a0ae64e
commit baee789236

View File

@ -16,13 +16,15 @@ export type MarkdownTag = {
match: string, match: string,
entityName: 'messageEntityBold' | 'messageEntityUnderline' | 'messageEntityItalic' | 'messageEntityPre' | 'messageEntityStrike' | 'messageEntityTextUrl' | 'messageEntityMentionName'; entityName: 'messageEntityBold' | 'messageEntityUnderline' | 'messageEntityItalic' | 'messageEntityPre' | 'messageEntityStrike' | 'messageEntityTextUrl' | 'messageEntityMentionName';
}; };
// https://core.telegram.org/bots/api#html-style
export const markdownTags: {[type in MarkdownType]: MarkdownTag} = { export const markdownTags: {[type in MarkdownType]: MarkdownTag} = {
bold: { bold: {
match: '[style*="bold"], [style*="font-weight: 700"], [style*="font-weight: 600"], [style*="font-weight:700"], [style*="font-weight:600"], b, strong', match: '[style*="bold"], [style*="font-weight: 700"], [style*="font-weight: 600"], [style*="font-weight:700"], [style*="font-weight:600"], b, strong',
entityName: 'messageEntityBold' entityName: 'messageEntityBold'
}, },
underline: { underline: {
match: '[style*="underline"], u', match: '[style*="underline"], u, ins',
entityName: 'messageEntityUnderline' entityName: 'messageEntityUnderline'
}, },
italic: { italic: {
@ -34,7 +36,7 @@ export const markdownTags: {[type in MarkdownType]: MarkdownTag} = {
entityName: 'messageEntityPre' entityName: 'messageEntityPre'
}, },
strikethrough: { strikethrough: {
match: '[style*="line-through"], strike, del', match: '[style*="line-through"], strike, del, s',
entityName: 'messageEntityStrike' entityName: 'messageEntityStrike'
}, },
link: { link: {