https://bugs.kde.org/show_bug.cgi?id=487235

--- Comment #5 from Corbin <schwimmbe...@gmail.com> ---
Looking into this more, I found the regular expression that find the style
color: "\\.ColorScheme-(\\S+){color:(#[0-9a-fA-F]+);}"
(https://invent.kde.org/frameworks/breeze-icons/-/blob/master/src/tools/generate-symbolic-dark.cpp?ref_type=heads)

Which works, until some of the svg files are formatted like this:
(actions/16/blur.svg)
    <style>.ColorScheme-Text { 
    color:#232629;
}</style>

There you'd need "\\.ColorScheme-(\\S+)\\s*{\\s*color:(#[0-9a-fA-F]+);\\s*}"

But it also fails for files like actions/16/bookmark-remove:
    <style type="text/css"
id="current-color-scheme">.ColorScheme-Text{color:#232629;}.ColorScheme-NegativeText
{ color: #da4453; } </style>

Matter of fact, the pattern also doesn't match the latter negative text color
scheme, due to the additional space between color: and the #,
needing even more \s* patterns to properly detect all of these edge cases.
Though for this one, it doesn't matter, as only Text and Background
are actually handled in the code anyway. Though it'd probably be simpler to
eliminate all whitespace before trying to use regex to parse this.

Interestingly, it did work for a different file, where that looked like this:
    <style type="text/css" id="current-color-scheme">.ColorScheme-Text { color:
#fcfcfc; } </style>
with spaces in various positions.

And another one where it failed was well formatted, with no whitespace:
    <style type="text/css"
id="current-color-scheme">.ColorScheme-Text{color:#232629;}.ColorScheme-NeutralText{color:#f67400;}.ColorScheme-NegativeText
{ color: #da4453; } </style>


The only consistent throughline here is that all the ones that failed, had more
than one ColorScheme set. Which shouldn't be the issue,
since a regex iterator is used, but that's just what must be happening.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to