PrettyCSS
PrettyCSS copied to clipboard
SVG data:URIs with length > ~700 chars and an unescaped newline will hang the parser
This problem is most prevalent when embedding SVG files as data:URIs. Sometimes a newline slips through without an escape. The following will hang PrettyCSS:
.svg-icon {
background-image: url("data:image/svg+xml,\
%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E\
%3Cpath d='M224%20387.814V512L32 320l192-192v126.912C447.375 \
260.152 437.794 103.016 380.93 0 521.287 151.707 491.48 394.785 224 \
387.814z'/%3E%\
%3Cpath d='M224%20387.814V512L32 320l192-192v126.912C447.375 \
260.152 437.794 103.016 380.93 0 521.287 151.707 491.48 394.785 224 \
387.814z'/%3E%\
%3Cpath d='M224%20387.814V512L32 320l192-192v126.912C447.375 \
260.152 437.794 103.016 380.93 0 521.287 151.707 491.48 394.785 224 \
387.814z'/%3E%\
%3Cpath d='M224%20387.814V512L32 320l192-192v126.912C447.375 \
260.152 437.794 103.016 380.93 0 521.287 151.707 491.48 394.785 224 \
387.814z'/%3E\
%3C/svg%3E
");
}
The unescaped newline is right before the end quote.