Closed
Bug 1421032
Opened 7 years ago
Closed 6 years ago
Detect Markdown attachment files as text/plain so Firefox can display the content
Categories
(bugzilla.mozilla.org :: General, enhancement, P2)
Tracking
()
RESOLVED
FIXED
People
(Reporter: francois, Assigned: kohei)
References
Details
Attachments
(2 files)
Markdown files that end with .md are given the wrong mimetype (application/x-genesis-rom) and therefore cannot be viewed inline in Bugzilla:
https://bugzilla.mozilla.org/attachment.cgi?id=8932125&action=edit
even though they're really plaintext files.
It would be great to add an override to text/plain at least because all new telemetry requests / data reviews now require attaching a .md file to a bug.
Updated•7 years ago
|
Assignee: attach-and-request → nobody
Component: Attachments & Requests → General
Product: Bugzilla → bugzilla.mozilla.org
QA Contact: default-qa
Version: unspecified → Production
This is blocking telemetry work, so marking as a P1.
Severity: normal → blocker
Priority: -- → P1
Updated•6 years ago
|
Priority: P1 → --
Updated•6 years ago
|
Priority: -- → P2
Comment 2•6 years ago
|
||
This is a very small change indeed, just special-casing the filename is probably sufficient. I'll take a look at this shortly.
Assignee: nobody → dylan
Assignee | ||
Comment 3•6 years ago
|
||
I think I have already solved this as part of Bug 602313. :francois, can you verify?
https://github.com/mozilla-bteam/bmo/blob/master/js/attachment.js#L417-L418
Assignee: dylan → kohei.yoshino
Status: NEW → RESOLVED
Closed: 6 years ago
Depends on: 602313
Flags: needinfo?(francois)
Resolution: --- → FIXED
Reporter | ||
Comment 4•6 years ago
|
||
Reporter | ||
Comment 5•6 years ago
|
||
No, it's still not fixed, see attachment 9011511 [details].
Status: RESOLVED → REOPENED
Flags: needinfo?(francois)
Resolution: FIXED → ---
Assignee | ||
Comment 7•6 years ago
|
||
Looks like the original issue has been solved. The MIME type of the attached review.md is text/markdown, but Firefox cannot show the content while Chrome can. That’s a different issue: Bug 1319262. It’s possible for Bugzilla to detect .md file as text/plain, but given that the official MIME type is text/markdown, we should probably keep it, close this bug and fix the Firefox bug.
Assignee | ||
Comment 8•6 years ago
|
||
So... closing.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago → 6 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 9•6 years ago
|
||
Given that the majority of people using our instance of Bugzilla are using Firefox, I think the work-around you mention makes sense (sending the text/plain mimetype when it's set to text/markdown). Bug 1319262 is P3, it's not going to get fixed anytime soon.
Assignee | ||
Comment 10•6 years ago
|
||
Yeah, the workaround is simple, but I’m still not sure what’s the best. Firefox (and other browsers) cannot preview Markdown files so some people may just want to download it and preview it in their favourite viewer, e.g. VS Code.
Assignee | ||
Comment 11•6 years ago
|
||
Maybe the best UX here is letting Bugzilla preview/render Markdown files instead showing the raw content, just like GitHub. Bugzilla already has a Markdown library for the Markdown comment support, so it should be possible to implement the Markdown file preview functionality.
Reporter | ||
Comment 12•6 years ago
|
||
Rendering Markdown files could be nice, but since Markdown files are already quite readable and it's way easier to just display them as text, I'd personally go with that as a first step and revisit later if there's time/desire to enhance.
Given that Paolo has confirmed that it's unlikely to get fixed in Firefox in the near term, let's reopen this bug until a decision is made on the work-around.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 13•6 years ago
|
||
Okay, let’s add a quick workaround to Bugzilla while waiting for the fix in Firefox.
Status: REOPENED → ASSIGNED
Summary: Markdown files are not recognized properly when attached to a bug → Detect Markdown attachment files as text/plain so Firefox can display the content
Assignee | ||
Comment 14•6 years ago
|
||
Assignee | ||
Comment 15•6 years ago
|
||
My PR doesn’t change the MIME type of the currently attached Markdown files. There are 46 bugs (only 5 open bugs) having Markdown file(s) so we can update them manually if needed.
Assignee | ||
Comment 16•6 years ago
|
||
Merged to master.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago → 6 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•