Skip to content

Improve robustness of icon font detection#397

Merged
tinchox5 merged 1 commit intozumerlab:mainfrom
RinZ27:fix/robust-font-detection
Apr 8, 2026
Merged

Improve robustness of icon font detection#397
tinchox5 merged 1 commit intozumerlab:mainfrom
RinZ27:fix/robust-font-detection

Conversation

@RinZ27
Copy link
Copy Markdown
Contributor

@RinZ27 RinZ27 commented Apr 8, 2026

The extendIconFonts method currently constructs a new RegExp(f, 'i') using developer-defined font names without escaping. This can lead to a SyntaxError if a font name includes regex-special characters like parentheses or plus signs (e.g., "My(Font)" or "Font+").

I've added an escapeRegExp utility to ensure these strings are treated as literal patterns during detection. This improvement makes the icon font detection more robust and prevents potential crashes when dealing with varied or complex font naming conventions. All existing tests pass and a reproduction case for the crash has been verified locally.

@tinchox5
Copy link
Copy Markdown
Member

tinchox5 commented Apr 8, 2026

@RinZ27 thank you! Merging!

@tinchox5 tinchox5 merged commit 61f2ab3 into zumerlab:main Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants