Mantis bugnotes formatting
Asked Answered
L

3

12

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 ?

Limit answered 1/11, 2010 at 22:40 Comment(0)
C
15

In Mantis one can use some of HTML tags (unfortunately not all are supported). From my experience (as I remember well) I've successfully used: <B>, <I>, <U>, <S> and lists, both ordered <OL><LI> and unordered (bullets): <UL><LI>. It makes notes and descriptions more readable.

Currently I'm using 1.1.8 version of Mantis but I was successfully using it in older version (prior to 1.0) - so yours should also handle that.

Chessman answered 14/12, 2010 at 5:42 Comment(2)
all allowed tags: git.mantisbt.org/…Microfarad
all allowed tags: github search for: g_html_valid_tagsUpanddown
T
19

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 :)

Taskwork answered 31/8, 2013 at 4:25 Comment(1)
Thanks, I have access to the installed code. +1 for detailed answer to a very old question.Limit
C
15

In Mantis one can use some of HTML tags (unfortunately not all are supported). From my experience (as I remember well) I've successfully used: <B>, <I>, <U>, <S> and lists, both ordered <OL><LI> and unordered (bullets): <UL><LI>. It makes notes and descriptions more readable.

Currently I'm using 1.1.8 version of Mantis but I was successfully using it in older version (prior to 1.0) - so yours should also handle that.

Chessman answered 14/12, 2010 at 5:42 Comment(2)
all allowed tags: git.mantisbt.org/…Microfarad
all allowed tags: github search for: g_html_valid_tagsUpanddown
W
1

Overwrite Mantis (ver.<1.3) default configuration by using your personal config_inc.php file under <mantis-doc-root>/config/config_inc.php

You can overwrite all default settings in this config file. E.g. $g_html_valid_tags, $g_bug_view_page_fields, ... Just copy/paste the default values from <mantis-doc-root>/config_defaults_inc.php to your <mantis-doc-root>/config/config_inc.php file.

Watercolor answered 21/9, 2016 at 11:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.