Open Bug 1881362 Opened 2 years ago Updated 2 years ago

URLs in HTML source-text get styled as if they are links, in bugzilla comment attachment-preview block

Categories

(bugzilla.mozilla.org :: User Interface, defect)

Production
defect

Tracking

()

People

(Reporter: dholbert, Unassigned)

Details

Attachments

(4 files)

When obsoleting some bogus attachments from spammers today (e.g. bug 1572483 comment 9), I noticed that the attachment-preview showed up with URLs styled as links (or at least as blue) in the plaintext document.

That seems to be a mistake, perhaps? I don't think we intend to do any special styling or processing on our preview of plaintext document attachments.

Attachment #9381870 - Attachment filename: test.txt → test.html
Attachment #9381870 - Attachment mime type: text/plain → text/html

ah, I misspoke slightly -- the spammers' attachments weren't quite plaintext -- they had mimetype text/html. Even so: it's still weird to have URLs auto-formatted as links, whether in HTML source-text or in plaintext files.

(So I've adjusted mine to have an HTML mimetype as well in an attempt to recreate the problem, though Bugzilla's not showing me a preview of the attachment inline in my bugzilla-comment right now, and that preview is the UI-in-question that I was hoping to highlight/test here.)

Summary: URLs in plaintext files get styled as if they are links → URLs in HTML source-text get styled as if they are links, in bugzilla comment attachment-preview block

Posting testcase 1 again, but with an accompanying comment this time, and with the mimetype set to text/html up-front (which may or may not matter, not sure).

(I guess I don't have a way to reliably trigger this, since I don't know how to force my text/html attachments here to display an inline file-preview, which is the context in which I saw this bug earlier today...)

Attached image screenshot of bug

Aha -- I was able to repro with https://bugzilla.mozilla.org/show_bug.cgi?id=1785884#c84 (a post from a spammer) which does currently show me an inline preview of the attachment over there.

Here's a screenshot.

Here's a screenshot showing devtools here, which reveals that these are in fact actual links (<a href="url">) in the DOM for the bugzilla-inline-preview. This linkification is something that Bugzilla is doing automagically -- they're not actual links in the attachment itself.

(Fortunately in this case (with a spam attachment), the links aren't actually clickable, since they're all inside of a <button> for the preview-area, which (when clicked) just opens the attachment rather than visiting the link.)

Probably we don't want to generate links or do any other sort of smart-formatting here, for our previews of attachment-text?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: