From 0c3690a8ba39518cc2d543befdafca03fadb3e66 Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 8 Jun 2024 18:00:29 +0000 Subject: [PATCH 1/2] upd: bold some Header tags --- packages/backend/src/core/MfmService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/MfmService.ts b/packages/backend/src/core/MfmService.ts index 819c940dc1..8a974f8323 100644 --- a/packages/backend/src/core/MfmService.ts +++ b/packages/backend/src/core/MfmService.ts @@ -129,14 +129,16 @@ export class MfmService { case 'h1': { - text += '【'; + text += '**【'; appendChildren(node.childNodes); - text += '】\n'; + text += '】**\n'; break; } case 'b': case 'strong': + case 'h2': + case 'h3': { text += '**'; appendChildren(node.childNodes); @@ -200,8 +202,6 @@ export class MfmService { } case 'p': - case 'h2': - case 'h3': case 'h4': case 'h5': case 'h6': From 4a9260a4326e526cf63ccb0d586098a0d0fe5067 Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 8 Jun 2024 18:53:42 +0000 Subject: [PATCH 2/2] upd: seperate H2/H3 into own case --- packages/backend/src/core/MfmService.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/MfmService.ts b/packages/backend/src/core/MfmService.ts index 8a974f8323..9b99e8ccfe 100644 --- a/packages/backend/src/core/MfmService.ts +++ b/packages/backend/src/core/MfmService.ts @@ -135,10 +135,17 @@ export class MfmService { break; } - case 'b': - case 'strong': case 'h2': case 'h3': + { + text += '**'; + appendChildren(node.childNodes); + text += '**\n'; + break; + } + + case 'b': + case 'strong': { text += '**'; appendChildren(node.childNodes);