Explorar el Código

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.
Jonah hace 2 años
padre
commit
fd0ee8ae7b
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Userland/Libraries/LibWeb/Scripts/GenerateStyleSheetSource.sh

+ 1 - 1
Userland/Libraries/LibWeb/Scripts/GenerateStyleSheetSource.sh

@@ -5,7 +5,7 @@ echo "namespace Web::CSS {"
 echo "extern StringView $1;"
 echo "StringView $1 = \"\\"
 grep -v '^ *#' < "$2" | while IFS= read -r line; do
-  echo "$line""\\"
+  echo "$line""\\" | sed 's/"/\\\"/g'
 done
 echo "\"sv;"
 echo "}"