这是indexloc提供的服务,不要输入任何密码
Skip to content

feat(integrations/telegram): add support for standard markdown #14060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 43 commits into
base: telegram_1.0.0
Choose a base branch
from

Conversation

JustinBordage
Copy link
Contributor

From Linear issue SQD-3049

@JustinBordage JustinBordage changed the base branch from master to telegram_1.0.0 July 22, 2025 21:06
- The markdown "__{text}__" was actually an alternative markdown for bold not italic
- Changed italic effect markdown from "_{text}_" to "*{text}*" since the underscore markdown only works when it's adjacent to whitespace in the text
- This is because we don't need to sort if there's only 1 or less elements
@JustinBordage JustinBordage force-pushed the jbord_telegram-markdown-converter branch from a30809b to c54d8e4 Compare July 24, 2025 20:47
Copy link
Member

@franklevasseur franklevasseur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is still a draft, so I don't want to add too many comments yet. Keep up the good work. I like what I read.

test.each(telegramToMarkdownTestCases)('$description', ({ input, expects }: TelegramToMarkdownTestCase) => {
const consoleWarn = console.warn

console.warn = (firstArg: unknown, ...args: unknown[]) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: This strategy will stop working as soon as you change the log message. Instead, your function applyMarksToText should return a list of warnings and errors. You can use these warnings in your tests and also log them in the actual integration's implementation

consoleWarn(firstArg, ...args)
}

expect(applyMarksToText(input.text, input.marks)).toBe(expects)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore: As we've already discussed in person, you shouldn't test internal private functions directly. These are implementation details and should be allowed to change without affecting the tests

@JustinBordage JustinBordage force-pushed the jbord_telegram-markdown-converter branch from 2297dc4 to f4463e2 Compare July 25, 2025 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants