瀏覽代碼

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 2 年之前
父節點
當前提交
fd0ee8ae7b
共有 1 個文件被更改,包括 1 次插入1 次删除
  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 "extern StringView $1;"
 echo "StringView $1 = \"\\"
 echo "StringView $1 = \"\\"
 grep -v '^ *#' < "$2" | while IFS= read -r line; do
 grep -v '^ *#' < "$2" | while IFS= read -r line; do
-  echo "$line""\\"
+  echo "$line""\\" | sed 's/"/\\\"/g'
 done
 done
 echo "\"sv;"
 echo "\"sv;"
 echo "}"
 echo "}"