1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 03:45:06 +00:00
serenity/Userland/Libraries/LibWeb/Scripts/GenerateStyleSheetSource.sh
Jonah fd0ee8ae7b LibWeb: Escape quotes in style sheet sources
Some rules in style sheets contain quotes, escaping them allows us to
generate code that actually compiles for them.
2023-08-12 07:59:23 +01:00

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 "}"