factor out kjol auth
This commit is contained in:
@@ -31,8 +31,12 @@ var faStyleDirs = map[string]string{
|
||||
var (
|
||||
// icon="name" / icon: "name"
|
||||
reIconAttr = regexp.MustCompile(`\bicon\s*(?:=|:)\s*"([a-z0-9][a-z0-9-]*)"`)
|
||||
// icon={ ... } — dynamic expressions; pull any string literals (ternaries etc.)
|
||||
reIconBrace = regexp.MustCompile(`\bicon\s*=\s*\{([^}]*)\}`)
|
||||
// icon={ ... } — a dynamic expression; pull any string literals out of it
|
||||
// (ternaries etc.). The `$` is optional because both authoring styles in this
|
||||
// codebase have to be seen: JSX writes icon={"bell"}, while a solid-js/html
|
||||
// tagged template writes icon=${"bell"}. Missing the second form drops the
|
||||
// icon from the registry silently — it simply renders blank at runtime.
|
||||
reIconBrace = regexp.MustCompile(`\bicon\s*=\s*\$?\{([^}]*)\}`)
|
||||
reStrLit = regexp.MustCompile(`"([a-z0-9][a-z0-9-]*)"`)
|
||||
reViewBox = regexp.MustCompile(`viewBox="0 0 ([0-9.]+) ([0-9.]+)"`)
|
||||
rePathD = regexp.MustCompile(`<path[^>]*\bd="([^"]+)"`)
|
||||
|
||||
Reference in New Issue
Block a user