LibWebView: Highlight CSS and JS in view-source

The colors and categories here could probably be better, but it works.
:^)
This commit is contained in:
Sam Atkins 2024-09-24 16:30:23 +01:00 committed by Sam Atkins
commit bd6fdbf312
Notes: github-actions[bot] 2024-09-30 07:54:36 +00:00
2 changed files with 135 additions and 17 deletions

View file

@ -84,6 +84,8 @@ constexpr inline StringView HTML_HIGHLIGHTER_STYLE = R"~~~(
--name-color: orange;
--value-color: deepskyblue;
--internal-color: darkgrey;
--string-color: goldenrod;
--error-color: red;
}
}
@ -94,6 +96,8 @@ constexpr inline StringView HTML_HIGHLIGHTER_STYLE = R"~~~(
--name-color: darkorange;
--value-color: blue;
--internal-color: dimgrey;
--string-color: darkgoldenrod;
--error-color: darkred;
}
}
@ -118,6 +122,19 @@ constexpr inline StringView HTML_HIGHLIGHTER_STYLE = R"~~~(
.internal {
color: var(--internal-color);
}
.invalid {
color: var(--error-color);
text-decoration: currentColor wavy underline;
}
.at-keyword, .function, .keyword, .control-keyword, .url {
color: var(--keyword-color);
}
.number, .hash {
color: var(--value-color);
}
.string {
color: var(--string-color);
}
)~~~"sv;
}