Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mantis bugnotes formatting

Tags:

mantis

Is it possible to format bugnotes(comments) entered in Mantis bug tracker for an issue ?

I am using Mantis v1.0.8

e.g.

"sample mantis bug notes"

which appears as plain text.

I would like to make it bold or to display in different color

e.g. similar to https://stackoverflow.com/editing-help

does any other bug tracking system allow such feature ?

like image 761
N30 Avatar asked Nov 01 '10 22:11

N30


1 Answers

As it was said by Gawcio and mhu, the list is limited and in current mantis 1.2.15 use of following tags is allowed in description and other multi-line fields: <p>, <li>, <ul>, <ol>, <br>, <pre>, <i>, <b>, <u>, <em>, <strong>.

Additionally, following tags are allowed in summary and other single-line fields (e.g. OS or Platform): <i>, <b>, <u>, <em>, <strong>. That's funny to have some emphasis in issue summary, right? :)

What is not explicitly said, is that these lists are customizable. Unfortunately, they are so-called global settings, so they can't be set using web interface, but if you have a possibility of tweaking the installed mantis code, you can modify the <mantis-doc-root>/config_inc.php file (which is purposed to be modified locally) and add following options there:

/**
 * These are the valid html tags for multi-line fields (e.g. description)
 * [...]
 */
$g_html_valid_tags = 'p, li, ul, ol, br, pre, i, b, u, em, strong, code';

/**
 * These are the valid html tags for single line fields (e.g. issue summary).
 * [...]
 */
$g_html_valid_tags_single_line = 'i, b, u, em, strong, code';

After server restart, you should be able to use the <code> tag in summary and description of your issues.

Unfortunately, mantis tags filters seem to disallow any tag attributes, so it won't be easy to allow free formatting. Personally, I have adjusted its style sheet to tweak the colour in which content of <pre> and <code> tags is displayed. To achieve it, you can edit the <mantis-doc-root>/css/default.css` file and add/adjust following rules:

pre         { margin-top: 0px; margin-bottom: 0px; color: #0000CC; }
code        { color: #0000CC; }
em > strong { color: #CC0000; }

This way your report may gain some colours :)

like image 60
Dariusz Walczak Avatar answered Oct 11 '22 03:10

Dariusz Walczak