Skip to content

Commit

Permalink
Tag default pattern (#833)
Browse files Browse the repository at this point in the history
* feat: added a and span tag for default patterns

* fix: fixed pattern not working for link error
  • Loading branch information
KlausMikhaelson authored Nov 13, 2023
1 parent c274bae commit 3ac6137
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function newLinestyles(matchingString: string) {

function renderTextStyles(matchingString: string) {
const pattern =
/<PUSHText color=["']?(#[0-9A-Fa-f]{3,6}|[a-zA-Z]+)["']?>(.*?)<\/PUSHText>/i;
/<span color=["']?(#[0-9A-Fa-f]{3,6}|[a-zA-Z]+)["']?>(.*?)<\/span>/i;
const match = matchingString.match(pattern);

if (match) {
Expand Down Expand Up @@ -244,7 +244,7 @@ const DEFAULT_PATTERNS: CustomParseShape[] = [
},
{
pattern:
/<PUSHText color=["']?(#[0-9A-Fa-f]{3,6}|[a-zA-Z]+)["']?>(.*?)<\/PUSHText>/gi,
/<span color=["']?(#[0-9A-Fa-f]{3,6}|[a-zA-Z]+)["']?>(.*?)<\/span>/gi,
style: {}, // we can add aditional styles here if needed
renderText: renderTextStyles,
},
Expand Down

0 comments on commit 3ac6137

Please sign in to comment.