mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-12-03 16:59:42 +00:00
* fix(scripts): remove ambiguous regex in co-author parsing (ReDoS) The co-author trailer regex used \s+([^<]+)\s+< where both \s+ overlap with [^<]+, giving polynomial backtracking on long whitespace runs. \s([^<]+)\s< matches exactly the same strings and the same email group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G9u8FhTjfkTLPkCeVkHN6p * fix: escape all occurrences when sanitizing strings - base64SVG: replace every newline, not just the first one - createOGImage: escape & before < and > so tags aren't double-escaped Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G9u8FhTjfkTLPkCeVkHN6p --------- Co-authored-by: Claude <noreply@anthropic.com>
12 lines
287 B
TypeScript
12 lines
287 B
TypeScript
const base64SVG = (svgContents: string) =>
|
|
Buffer.from(
|
|
svgContents
|
|
.replaceAll('\n', '')
|
|
.replace(
|
|
'stroke="currentColor"',
|
|
'stroke="#000" style="background-color: #fff; border-radius: 2px"',
|
|
),
|
|
).toString('base64');
|
|
|
|
export default base64SVG;
|