enclosing code in comments so mantis doesn't interpret

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Kunda
Posts: 9
Joined: 01 Jul 2015, 22:15

enclosing code in comments so mantis doesn't interpret

Post by Kunda »

What is the tag that needs to be put around a block of code in a mantis comment so it won't interpret html tags or special chars like ~ or #

EDIT: Example, if someone wants to add a backtrace and not have all the strings prepended with '#' be interpreted as an mantisbt issue number
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: enclosing code in comments so mantis doesn't interpret

Post by atrol »

This is not possible out of the box.
You can just deactivate the whole special treatment for ~ and # by using the configuration page of the MantisCoreFormatting plugin.
Please use Search before posting and read the Manual
Kunda
Posts: 9
Joined: 01 Jul 2015, 22:15

Re: enclosing code in comments so mantis doesn't interpret

Post by Kunda »

atrol wrote:This is not possible out of the box.
You can just deactivate the whole special treatment for ~ and # by using the configuration page of the MantisCoreFormatting plugin.
Yea.. that's not the answer I was hoping for.
What are other workarounds ?
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: enclosing code in comments so mantis doesn't interpret

Post by atrol »

Workarounds (not really):

1) If you start from scratch you could change the bug link tag by adding the following line to file config_inc.php, and adjust to your needs, something where you think it will not appear in normal text, e.g.

Code: Select all

$g_bug_link_tag = 'bug#';
2) I had a look at the example you mentioned in IRC
You could attach traces as text files instead of posting them in field additional information.

Solution

Introduce a new option in Mantis (or better an option in MantisCoreFormatting plugin.), e.g. something like $g_no_link_tag = 'nolink';
To allow posts like
<nolink>This is no link for issue #4711</nolink>
Please use Search before posting and read the Manual
Kunda
Posts: 9
Joined: 01 Jul 2015, 22:15

Re: enclosing code in comments so mantis doesn't interpret

Post by Kunda »

Yea.. see if I take workaround #1 then all previous issues that use that formatting break.
Attaching traces as texts is not ideal, but I see the ingenuity in it.

I think the <nolink> solution is the best one. Will it also not interpret html tags?
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: enclosing code in comments so mantis doesn't interpret

Post by atrol »

Kunda wrote:Will it also not interpret html tags?
Depends on how it would be implemented.
Don't expect that there will be something implemented. This is nothing more than a proposal from me.

If you want this feature in a future version you have to
- enter a feature request at http://www.manisbt.org/bugs
- wait until someone is interested in implementing it (maybe years) or much better
- fork us on GitHub and send a pull request

I know, that's not the answer you are hoping for ;-)
Please use Search before posting and read the Manual
Post Reply