Skip to content

Commit

Permalink
fix: prevent anchor font size override when it's part of a heading
Browse files Browse the repository at this point in the history
  • Loading branch information
gmsgowtham committed Aug 6, 2023
1 parent 8b16bad commit cbd0b5c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/Parser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cbd0b5c

Please sign in to comment.