mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-09 09:20:54 +00:00
UBERF-11067: Minor fixes
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
parent
651dc4eb51
commit
3ceb9c4a0e
File diff suppressed because one or more lines are too long
@ -78,6 +78,10 @@ describe('getMdContent', () => {
|
||||
// Verify we have the expected guest entries
|
||||
expect(result).toContain('John Doe')
|
||||
expect(result).toContain('Sarah Jones')
|
||||
|
||||
expect(result).toContain('[Yes](https://example.com/1)')
|
||||
expect(result).toContain('[No](https://example.com/2)')
|
||||
expect(result).toContain('[Maybe](https://example.com/3)')
|
||||
})
|
||||
|
||||
it('should handle undefined content gracefully', () => {
|
||||
|
@ -33,10 +33,10 @@ export function getMdContent (ctx: MeasureContext, email: EmailMessage): string
|
||||
const title = element.title ?? ''
|
||||
// Trim content to prevent empty lines inside links
|
||||
const trimmedContent = content.trim().replace(/\n\s*\n/g, ' ')
|
||||
if (!href) {
|
||||
if (href == null) {
|
||||
return trimmedContent
|
||||
}
|
||||
const titlePart = title ? ` "${title}"` : ''
|
||||
const titlePart = title !== '' ? ` "${title}"` : ''
|
||||
return `[${trimmedContent}](${href}${titlePart})`
|
||||
} catch (error: any) {
|
||||
ctx.warn('Failed to parse link', { error: error.message })
|
||||
|
Loading…
Reference in New Issue
Block a user