fix regexes

This commit is contained in:
James Brumond 2023-05-09 21:38:23 -07:00
parent 126803c489
commit 9d233a8dc3
Signed by: james
GPG Key ID: E8F2FC44BAA3357A

View File

@ -45,18 +45,18 @@ type CSSVarColor
; ;
const text_regex: Record<CSSVarColor, RegExp> = { const text_regex: Record<CSSVarColor, RegExp> = {
black: /\b<text fill="rgb\(0,0,0\)"/gi, black: /<text fill="rgb\(0,0,0\)"/gi,
red: /\b<text fill="rgb\(255,0,0\)"/gi, red: /<text fill="rgb\(255,0,0\)"/gi,
orange: /\b<text fill="rgb\(255,165,0\)"/gi, orange: /<text fill="rgb\(255,165,0\)"/gi,
yellow: /\b<text fill="rgb\(255,255,0\)"/gi, yellow: /<text fill="rgb\(255,255,0\)"/gi,
green: /\b<text fill="rgb\(0,128,0\)"/gi, green: /<text fill="rgb\(0,128,0\)"/gi,
teal: /\b<text fill="rgb\(0,128,128\)"/gi, teal: /<text fill="rgb\(0,128,128\)"/gi,
pink: /\b<text fill="rgb\(255,192,203\)"/gi, pink: /<text fill="rgb\(255,192,203\)"/gi,
purple: /\b<text fill="rgb\(128,0,128\)"/gi, purple: /<text fill="rgb\(128,0,128\)"/gi,
blue: /\b<text fill="rgb\(0,0,255\)"/gi, blue: /<text fill="rgb\(0,0,255\)"/gi,
indigo: /\b<text fill="rgb\(75,0,130\)"/gi, indigo: /<text fill="rgb\(75,0,130\)"/gi,
magenta: /\b<text fill="rgb\(255,0,255\)"/gi, magenta: /<text fill="rgb\(255,0,255\)"/gi,
brown: /\b<text fill="rgb\(165,42,42\)"/gi, brown: /<text fill="rgb\(165,42,42\)"/gi,
}; };
const line_regex: Record<CSSVarColor, RegExp> = { const line_regex: Record<CSSVarColor, RegExp> = {
@ -75,18 +75,18 @@ const line_regex: Record<CSSVarColor, RegExp> = {
}; };
const shape_fill_regex = { const shape_fill_regex = {
black: /\b<path style="fill:rgb\(0,0,0\)/gi, black: /<path style="fill:rgb\(0,0,0\)/gi,
red: /\b<path style="fill:rgb\(255,0,0\)/gi, red: /<path style="fill:rgb\(255,0,0\)/gi,
orange: /\b<path style="fill:rgb\(255,165,0\)/gi, orange: /<path style="fill:rgb\(255,165,0\)/gi,
yellow: /\b<path style="fill:rgb\(255,255,0\)/gi, yellow: /<path style="fill:rgb\(255,255,0\)/gi,
green: /\b<path style="fill:rgb\(0,128,0\)/gi, green: /<path style="fill:rgb\(0,128,0\)/gi,
teal: /\b<path style="fill:rgb\(0,128,128\)/gi, teal: /<path style="fill:rgb\(0,128,128\)/gi,
pink: /\b<path style="fill:rgb\(255,192,203\)/gi, pink: /<path style="fill:rgb\(255,192,203\)/gi,
purple: /\b<path style="fill:rgb\(128,0,128\)/gi, purple: /<path style="fill:rgb\(128,0,128\)/gi,
blue: /\b<path style="fill:rgb\(0,0,255\)/gi, blue: /<path style="fill:rgb\(0,0,255\)/gi,
indigo: /\b<path style="fill:rgb\(75,0,130\)/gi, indigo: /<path style="fill:rgb\(75,0,130\)/gi,
magenta: /\b<path style="fill:rgb\(255,0,255\)/gi, magenta: /<path style="fill:rgb\(255,0,255\)/gi,
brown: /\b<path style="fill:rgb\(165,42,42\)/gi, brown: /<path style="fill:rgb\(165,42,42\)/gi,
} }
const arrow_head_regex: Record<CSSVarColor, RegExp> = { const arrow_head_regex: Record<CSSVarColor, RegExp> = {
@ -135,7 +135,7 @@ const text_css_vars: Record<CSSVarColor, string> = {
}; };
const fill_css_vars: Record<CSSVarColor, string> = { const fill_css_vars: Record<CSSVarColor, string> = {
black: 'var(--theme-chart-shape-black-fill, transparent)', black: 'var(--theme-bg-heavy, transparent)',
red: 'var(--theme-chart-shape-red-fill, transparent)', red: 'var(--theme-chart-shape-red-fill, transparent)',
orange: 'var(--theme-chart-shape-orange-fill, transparent)', orange: 'var(--theme-chart-shape-orange-fill, transparent)',
yellow: 'var(--theme-chart-shape-yellow-fill, transparent)', yellow: 'var(--theme-chart-shape-yellow-fill, transparent)',