Public repository: timo / schach

Reader

Ein aufgeräumtes Schach-Programm für GNOME

style(coach): italic square names instead of a gold box

public

style(coach): italic square names instead of a gold box

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changeset3415dd0b7179fbd9bd10e7bdb1e384fa861da36b
Author (claimed)Timo Stolz <timo.stolz@nullachtvierzehn.de>,
Parentsb21cd2b69a71
Children7448e7956cae
Pushlog
by timo via ssh
by timo via ssh

modified schach/training.py +2 −2

@@ -101,12 +101,12 @@ TAG_RE = re.compile(r"(<[^>]*>)")
101101
 
102102
 
103103
 def mark_squares(markup):
104
-    """Feldnamen im Pango-Markup blassgelb hinterlegen – wie das goldene Leuchten auf dem Brett."""
104
+    """Feldnamen im Pango-Markup kursiv setzen: Maus darüber, und das Feld leuchtet auf dem Brett."""
105105
     parts = TAG_RE.split(markup)
106106
     for i in range(0, len(parts), 2):  # gerade Stellen sind Text, ungerade Tags
107107
         text = parts[i]
108108
         for start, end, _sq in reversed(squares_in(text)):
109
-            text = (f"{text[:start]}<span bgcolor='#f5c219' bgalpha='35%'>{text[start:end]}</span>"
109
+            text = (f"{text[:start]}<i>{text[start:end]}</i>"
110110
                     f"{text[end:]}")
111111
         parts[i] = text
112112
     return "".join(parts)

modified tests/test_opening.py +2 −2

@@ -215,5 +215,5 @@ class SquareNamesTest(unittest.TestCase)
215215
         from schach.training import mark_squares
216216
         out = mark_squares("<span alpha='70%'>Warum?</span>\n<b>3. Lc4</b> – auf f7")
217217
         self.assertIn("<span alpha='70%'>Warum?</span>", out)
218
-        self.assertEqual(out.count("bgcolor"), 2)
219
-        self.assertIn(">c4</span></b>", out)
218
+        self.assertEqual(out.count("<i>"), 2)
219
+        self.assertIn("<i>c4</i></b>", out)