Support markdown tables

RESOLVED FIXED in Bugzilla 6.0

Status

()

Bugzilla
Creating/Changing Bugs
--
enhancement
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: Albert Ting, Assigned: Albert Ting)

Tracking

({relnote})

Bugzilla 6.0
relnote
Bug Flags:
approval +

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

4 years ago
Since Bugzilla's markdown appears to prevent <table> syntax, it would be nice if native table support was available, similar to GFM Markdown.  

Can this be done in Bugzilla::Markdown or does it require an enhancement to Text::Markdown?

Updated

4 years ago
Duplicate of this bug: 1130692
Note to eventual implementor: Text::MultiMarkdown[1] seems like a drop in replacement for Text::Markdown which Bugzilla currently depends on. The Text::MultiMarkdown is an extension to standard Markdown so should be compatible and provides support for tables, footnotes, citations and more[2].

[1] https://metacpan.org/pod/Text::MultiMarkdown
[2] http://fletcherpenney.net/multimarkdown/
(Assignee)

Comment 3

4 years ago
Created attachment 8560904 [details] [diff] [review]
bug-1130691-markdown-table

Thanks for the pointer to MultiMarkdown.  Not sure if additional overrides are needed, but merely switching to MultiMarkdown worked quite well.  There are some minor quirks with the table formatting (multi-column alignment and escape), but I can live with until it gets fixed in MultiMarkdown.

Attach is a small patch.  Then adding some small styling in global.css, such as 

.bz_comment_text table {
    border-collapse:collapse;
}

.bz_comment_text table, .bz_comment_text th, .bz_comment_text td {
    border: 1px solid #969696;
}
Make sure you set review? to someone when attaching a patch if you need a proper review.
Assignee: create-and-change → altlist
Status: NEW → ASSIGNED
(Assignee)

Comment 5

4 years ago
Comment on attachment 8560904 [details] [diff] [review]
bug-1130691-markdown-table

Sure.. :)  Hopefully there's not much more too this, other than maybe enhanced documentation.
Attachment #8560904 - Flags: review?(dkl)
(Assignee)

Comment 6

4 years ago
Created attachment 8561552 [details] [diff] [review]
bug-1130691-markdown-table

Updated version with sample documentation and css styling
Attachment #8560904 - Attachment is obsolete: true
Attachment #8560904 - Flags: review?(dkl)
Attachment #8561552 - Flags: review?
(Assignee)

Updated

4 years ago
Attachment #8561552 - Flags: review? → review?(dkl)
(Assignee)

Updated

4 years ago
Attachment #8561552 - Attachment is patch: true
Attachment #8561552 - Attachment mime type: text/x-patch → text/plain
Comment on attachment 8561552 [details] [diff] [review]
bug-1130691-markdown-table

Review of attachment 8561552 [details] [diff] [review]:
-----------------------------------------------------------------

-> perl t/005whitespace.t 
not ok 380 - template/en/default/pages/markdown.html.tmpl contains tabs --WARNING
#   Failed test 'template/en/default/pages/markdown.html.tmpl contains tabs --WARNING'
#   at t/005whitespace.t line 37.

Rest looks good.

::: template/en/default/pages/markdown.html.tmpl~
@@ +356,5 @@
> +        Apple
> +        :   Pomaceous fruit of plants of the genus Malus in 
> +            the family Rosaceae.
> +        :   An american computer company.
> +        

Remove all trailing whitespace
Attachment #8561552 - Flags: review?(dkl) → review-
(Assignee)

Comment 8

3 years ago
Created attachment 8572945 [details] [diff] [review]
v2

Updated version. 005whitespace test passed
Attachment #8561552 - Attachment is obsolete: true
Attachment #8572945 - Flags: review?(dkl)
Comment on attachment 8572945 [details] [diff] [review]
v2

Review of attachment 8572945 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl
Attachment #8572945 - Flags: review?(dkl) → review+

Updated

3 years ago
Flags: approval?
Flags: approval? → approval+
Target Milestone: --- → Bugzilla 6.0
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   1f54136..ee27d53  master -> master
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Keywords: relnote
Resolution: --- → FIXED
(Assignee)

Comment 11

3 years ago
Thanks David/Bryon.  Will be using this in 5.0.

Comment 12

3 years ago
Comment on attachment 8572945 [details] [diff] [review]
v2

>+++ Bugzilla/Install/Requirements.pm    2015-02-07 12:23:32.293977714 -0600

>+        package => 'Text-MultiMarkdown',
>+        module  => 'Text::MultiMarkdown',
>+        version => '1.000035',
>         feature => ['markdown'],

Why is 1.0.35 specifically required? Is there some feature which doesn't exist in 1.0.34 or older? 1.0.35 has been released in July 2014 and so is pretty new (my Linux distro, which is older than that, doesn't have such a recent version). For comparison, 1.0.34 has been released in April 2011 and so is more likely to be available in Linux distros. If there is no reason for this specific version, this requirement should be relaxed.
Flags: needinfo?(dkl)
(Assignee)

Comment 13

3 years ago
Created attachment 8576153 [details] [diff] [review]
v3

Version 1.000034 can be used.  I've updated the patch accordingly.
Attachment #8576153 - Flags: review?(LpSolit)

Comment 14

3 years ago
Comment on attachment 8576153 [details] [diff] [review]
v3

As the other patch has already been checked in, a diff against that already checked in patch would be needed. But it's a one-liner, so I did it manually.

To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   17d05cc..e3fc6a0  master -> master
Attachment #8576153 - Attachment is obsolete: true
Flags: needinfo?(dkl)
Attachment #8576153 - Flags: review?(LpSolit)
You need to log in before you can comment on or make changes to this bug.