Closed Bug 1305859 Opened 9 years ago Closed 9 years ago

Single-commit TreeHerder view has HTML-encoding junk for special characters in <title> (e.g. the word "Don&#39;t" instead of "Don't")

Categories

(Tree Management :: Treeherder, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: KWierso)

Details

Attachments

(3 files)

STR: 1. Visit https://treeherder.mozilla.org/#/jobs?repo=try&revision=afc4f662467c926ea40bb5b35c05cdae3e6ab3e0 (or the TreeHerder page for any Try run with a single-quote early in the commit message) 2. Look at the page title, in your browser's title bar. EXPECTED RESULTS: The page title should have the commit message, including the word "Don't". ACTUAL RESULTS: The page title has the word "Don&#39;t" with HTML-encoding junk in it. I understand that we need to encode special characters, for security reasons. I don't immediately see why that encoded special character is showing up in the actual rendered <title>, though. If it's properly encoded & set, it should still be rendered as a single-quote character in the title bar -- not as Don&#39;t.
Summary: Single-commit TreeHerder view has HTML-encoding junk for special characters in <title> → Single-commit TreeHerder view has HTML-encoding junk for special characters in <title> (e.g. the word "Don&#39;t" instead of "Don't")
For comparison, here's a simple page with a title that includes "&#39;" (in the word "Here's") This renders as a nice single-quote in my titlebar, unlike TreeHerder.
Attached image screenshot of bug
Here's a screenshot, showing that the HTML encoding of the single-quote character is cluttering up the page title in Firefox and Chrome (circled in red), though it renders correctly in the page body (circled in green).
Assignee: nobody → wkocher
Comment on attachment 8795527 [details] [review] [treeherder] KWierso:singletitleescape > mozilla:master I'm not sure if anything would break by doing this, but it appears to properly render the apostrophe in the linked push.
Attachment #8795527 - Flags: review?(wlachance)
I could change ui/index.html from using ng-bind="getWindowTitle()" to using ng-bind-html="getWindowTitle()", but that seems riskier. (Could it somehow close off the title tag and write arbitrary HTML?)
Comment on attachment 8795527 [details] [review] [treeherder] KWierso:singletitleescape > mozilla:master This looks very sane to me! I think this is the right solution -- I don't think using ng-bind-html in this case is warranted (I doubt it would even work).
Attachment #8795527 - Flags: review?(wlachance) → review+
Commit pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/faf871536b21140d124413bc74faf267f96b5963 Bug 1305859 - Make sure HTML-encoded characters render correctly in the title (#1877) r=wlach
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: