Skip to content

Commit

Permalink
fix: fixed pattern not working for link error
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausMikhaelson committed Nov 13, 2023
1 parent e8c402e commit 8fd16ee
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function renderTextStyles(matchingString: string) {

function renderLinkWithColor(matchingString: string) {
const pattern =
/<a color=["']?(#[0-9A-Fa-f]{3,6}|[a-zA-Z]+)["']?\s+href=["'](https?:\/\/[^"']+)["']>(.*?)<\/a>/i;
/<PUSHText color=["']?(#[0-9A-Fa-f]{3,6}|[a-zA-Z]+)["']?\s+link=["'](https?:\/\/[^"']+)["']>(.*?)<\/PUSHText>/i;
const linkPattern = /\[([^\]]+)]\((https?:\/\/[^)]+)/;
const match = matchingString.match(pattern);
const markdownLinkPattern = matchingString.match(linkPattern);
Expand Down Expand Up @@ -250,7 +250,7 @@ const DEFAULT_PATTERNS: CustomParseShape[] = [
},
{
pattern:
/<a color=["']?(#[0-9A-Fa-f]{3,6}|[a-zA-Z]+)["']?\s+href=["'](https?:\/\/[^"']+)["']>(.*?)<\/a>/gi,
/<PUSHText color=["']?(#[0-9A-Fa-f]{3,6}|[a-zA-Z]+)["']?\s+link=["'](https?:\/\/[^"']+)["']>(.*?)<\/PUSHText>/gi,
style: {}, // can Add additional styles here if needed
renderText: renderLinkWithColor,
},
Expand Down

0 comments on commit 8fd16ee

Please sign in to comment.