%xEx{ansi(Style=Spock)} and %xEx{ansi(Style=Kirk)} render with no styling at all.
Two defects in JAnsiTextRenderer:
JAnsiTextRenderer.java:217 — the predefined map is merged with map.putAll(predefinedMap),
which keeps its keys as written (Name, Message, …), but lookup at line 247 is
styleMap.get(toRootUpperCase(styleName)), so nothing ever matches. The name falls through to
AnsiEscape.createSequence("Name"), which warns and returns an empty ESC[m.
JAnsiTextRenderer.java:97-101 — entry() builds CSI + code + code with no ; separator
and no m suffix, so entry("Name", BG_RED, WHITE) yields ESC[4137. merge() at line 263
then strips a trailing m that was never appended. Masked today by (1).
Reproduced against 2.x HEAD, new JAnsiTextRenderer(new String[] {"ansi", "Style=Spock"}, emptyMap()):
Name -> ESC[m XYZ ESC[m
Name,Message -> ESC[;m XYZ ESC[m
bg_red,white -> ESC[41;37m XYZ ESC[m (user-supplied styles are fine)
main has both defects in the renamed AnsiTextRenderer (lines 192, 96-99, 238).
Found while reviewing #4184; unrelated to that PR.
%xEx{ansi(Style=Spock)}and%xEx{ansi(Style=Kirk)}render with no styling at all.Two defects in
JAnsiTextRenderer:JAnsiTextRenderer.java:217— the predefined map is merged withmap.putAll(predefinedMap),which keeps its keys as written (
Name,Message, …), but lookup at line 247 isstyleMap.get(toRootUpperCase(styleName)), so nothing ever matches. The name falls through toAnsiEscape.createSequence("Name"), which warns and returns an emptyESC[m.JAnsiTextRenderer.java:97-101—entry()buildsCSI + code + codewith no;separatorand no
msuffix, soentry("Name", BG_RED, WHITE)yieldsESC[4137.merge()at line 263then strips a trailing
mthat was never appended. Masked today by (1).Reproduced against
2.xHEAD,new JAnsiTextRenderer(new String[] {"ansi", "Style=Spock"}, emptyMap()):mainhas both defects in the renamedAnsiTextRenderer(lines 192, 96-99, 238).Found while reviewing #4184; unrelated to that PR.