From c2f7f3e58a18927bb762acab99d8db3beca0d2ee Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 1 Mar 2010 11:26:40 -0800 Subject: Fix tab marker RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK Inserting the HTML entity confused the prettify engine when we were running in debug hosted mode. Instead of the Unicode character we expected, we got an ASCII "W". Use the actual character in the source code rather than the entity, this should reduce the risk that the prettify engine or the browser will become confused and misrender it. Also correct the coloring, now that its a real character prettify is converting it into a class named 'pun', which is contained within the 'vt' class we created. But if syntax highlighting is off that 'pun' class doesn't exist, so we need CSS selectors for both cases. Change-Id: I8ac03bf00cd4493ea53dcf3573cc2ba92455dfbf Signed-off-by: Shawn O. Pearce --- .../main/java/com/google/gerrit/prettify/common/PrettyFormatter.java | 2 +- .../src/main/resources/com/google/gerrit/prettify/client/gerrit.css | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'gerrit-prettify') diff --git a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/common/PrettyFormatter.java b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/common/PrettyFormatter.java index 0d6d72c22f..e862e66422 100644 --- a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/common/PrettyFormatter.java +++ b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/common/PrettyFormatter.java @@ -326,7 +326,7 @@ public abstract class PrettyFormatter implements SparseHtmlFile { if (settings.isShowTabs()) { String t = 1 < settings.getTabSize() ? "\t" : ""; - html = html.replaceAll("\t", "»" + t); + html = html.replaceAll("\t", "\u00BB" + t); } return html.asString(); diff --git a/gerrit-prettify/src/main/resources/com/google/gerrit/prettify/client/gerrit.css b/gerrit-prettify/src/main/resources/com/google/gerrit/prettify/client/gerrit.css index 26d095c7d4..86f53d69ed 100644 --- a/gerrit-prettify/src/main/resources/com/google/gerrit/prettify/client/gerrit.css +++ b/gerrit-prettify/src/main/resources/com/google/gerrit/prettify/client/gerrit.css @@ -17,6 +17,7 @@ @external .vt; @external .wdd; @external .wdi; +@external .pun; .wse { background: red; @@ -38,7 +39,9 @@ * so we have to override the contained style. */ .wse .vt, -.wdd .vt { +.wdd .vt, +.wse .vt .pun, +.wdd .vt .pun { color: black; } .wse .wdd { -- cgit v1.2.3