mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 16:55:08 +00:00

Some rules in style sheets contain quotes, escaping them allows us to generate code that actually compiles for them.
11 lines
247 B
Bash
Executable file
11 lines
247 B
Bash
Executable file
#!/bin/sh
|
|
|
|
echo "#include <AK/StringView.h>"
|
|
echo "namespace Web::CSS {"
|
|
echo "extern StringView $1;"
|
|
echo "StringView $1 = \"\\"
|
|
grep -v '^ *#' < "$2" | while IFS= read -r line; do
|
|
echo "$line""\\" | sed 's/"/\\\"/g'
|
|
done
|
|
echo "\"sv;"
|
|
echo "}"
|