Browse Source

Added missing html-tags for parsing

master
morethanwords 3 years ago
parent
commit
baee789236
  1. 6
      src/helpers/dom/getRichElementValue.ts

6
src/helpers/dom/getRichElementValue.ts

@ -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: {

Loading…
Cancel
Save