mirror of
https://github.com/iconify/iconify.git
synced 2024-11-09 14:50:56 +00:00
Merge remote-tracking branch 'btbman/trim' into next
This commit is contained in:
commit
3b3fb518c3
@ -4,6 +4,8 @@
|
||||
export function trimSVG(str: string): string {
|
||||
return (
|
||||
str
|
||||
// Replace multi lines attributes and keep one space between last " or ' of attribute and start letter of next attribute
|
||||
.replace(/(['"])\s*\n\s*([^>\\/\s])/g, '$1 $2')
|
||||
// Replace new line only after one of allowed characters that are not part of common attributes
|
||||
.replace(/(["';{}><])\s*\n\s*/g, '$1')
|
||||
// Keep one space in case it is inside attribute
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user