From cbd0b5ca275140aaaf4f84195fc2f02fc2fa410e Mon Sep 17 00:00:00 2001 From: Gowtham G Date: Sun, 6 Aug 2023 17:25:34 +0530 Subject: [PATCH] fix: prevent anchor font size override when it's part of a heading --- src/lib/Parser.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/Parser.tsx b/src/lib/Parser.tsx index d26169dd..fcab8e71 100644 --- a/src/lib/Parser.tsx +++ b/src/lib/Parser.tsx @@ -119,8 +119,11 @@ class Parser { // Note: Linking Images (https://www.markdownguide.org/basic-syntax/#linking-images) are wrapped // in paragraph token, so will be handled via `getNormalizedSiblingNodesForBlockAndInlineTokens` const linkStyle = { + ...this.styles.link, ...styles, - ...this.styles.link, // To override color property + // To override color and fontStyle properties + color: this.styles.link?.color, + fontStyle: this.styles.link?.fontStyle, }; const href = getValidURL(this.baseUrl, token.href); const children = this._parse(token.tokens, linkStyle);