View Issue Details

IDProjectCategoryView StatusLast Update
0024628mantisbtmarkdownpublic2024-04-03 02:11
Reporterzringele Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version2.12.1 
Target Version2.27.0Fixed in Version2.27.0 
Summary0024628: Double quotes " and lesser than sign < are shown as HTML entity within Markdown code blocks

When Markdown option is enabled in MantisCoreFormatting plugin, HTML special chars within backticks are displayed as the corresponding entities.

  • double quote " "
  • lesser than < <

Same issue with code blocks

" <
TagsNo tags attached.


related to 0024241 resolveddregad $g_html_valid_tags are not rendered if Markdown is enabled 
has duplicate 0025379 closedatrol Code in decription replacing html chars 
has duplicate 0023206 closeddregad Markdown shows html tags in code-block 
has duplicate 0024240 closeddregad XML in Markdown Code ist not rendered correct 
related to 0025405 closeddregad Links on summary, notes, and Details converted to other chars 
related to 0022175 closedjoel Markdown converting '<' within backticks to & lt; 
related to 0022246 closedjoel Markdown is converting '&' signs to (ampersand[amp;]) inside code block or backtick as well 
related to 0022315 resolveddregad Markdown converts " to " within code blocks and inline code 
related to 0024810 resolveddregad Markdown links/code always show HTML entities for Ampersand and Less-than sign 
child of 0022180 new Markdown issues following implementation in 0017920 




2018-07-24 05:42

reporter   ~0060309

& quot ; I mean



2018-07-24 05:59

developer   ~0060311


I was not able to reproduce your problem with a fresh install of the latest stable MantisBT release (2.15.0 at the moment).

If you are running an older version, I recommend that you upgrade to the latest (download from [1]). If after doing so the problem persists, do not hesitate to reopen the issue and provide detailed step-by-step instructions to reproduce the issue; the following additional information may also be useful:

  • Exact version of MantisBT, PHP, Database, Web server, Browser and Operating System
  • Relevant customizations (e.g. changes in config_inc.php, etc)
  • Installed plugins or custom functions ?
  • Was the MantisBT source code modified in any way ?




2018-07-24 08:14

reporter   ~0060312

Last edited: 2018-07-24 08:15

Looks like the problem is only when using " inside a code tag like this "



2018-07-24 15:06

developer   ~0060313

The PR that fixes 0024241 fixes also this issue.



2019-05-28 04:21

developer   ~0062147

Work-in-progress fix

batman magumbo

batman magumbo

2021-11-09 08:30

reporter   ~0066000

This is still an issue on brand new installations of Mantis as of November 2021.

There's a plugin called Imatic Mantis Formatting that's supposed to fix the issue, but it's meant to replace the native Mantis formatting plugin, and it requires PHP 7.4 and Composer.

I was running PHP 7.1 so I wrote a simpler plugin that just run alongside the native one and patches the problem.

Here: OT Mantis Markdown Fixer. Hope that helps someone.



2022-04-01 03:11

reporter   ~0066402

This is really sad that we can't display formatted code in a bug tracking system.

printf("hello world");


2023-04-28 19:16

reporter   ~0067715

I switched to mantishub hosting and this issue - code blocks converting quotes and other things to HTML entities - is still persisting. Since I'm not self hosting I can't install the "OT Mantis Markdown Fixer" referenced above. Does anyone have suggestions or new workarounds for this in a hosted situation? Thank you.



2023-09-17 09:15

reporter   ~0068116

Hi, this continues to be a big problem as we often paste code/HMTL fragments in tickets, and it's very inconvenient to have simple double quotes and less than sides rendered as entities. It's a big downside of switching to Mantishub, we would probably have stuck with our own hosting if we had known this. In our own hosting, we could use "

" to enclose code, but now 
 doesn't work. 

I understand this bug may be too complex too fix (or not considered worth fixing), but could someone at least tell me some other block quote we can use for code chunks, since "```" does not work, something similar to

? Or should we just go old school, paste it as ordinary text and put some delimiter like "**" before and after? Thank you.



2023-09-18 06:12

developer   ~0068118

this continues to be a big problem as we often paste code/HMTL fragments in tickets, and it's very inconvenient to have simple double quotes and less than sides rendered as entities

@avr I am fully aware of that, and understand how problematic it could be. For the record, this impacts us on this tracker as well.

bug may be too complex too fix (or not considered worth fixing),

Rest assured that this bug is definitely worth fixing, and remains on the to-do list (otherwise this issue would have been closed a long time ago).

Unfortunately, as you guessed it is not so simple to resolve it in a manner that maintains compatibility across all use cases. This is why this issue has remained pending for so long, considering that I am not able to spend as much time to work on Mantis as I used to.

I am sorry, but I have no alternative to offer you, other than the 3rd-party plugins mentioned earlier in this thread. If your problem is with MantisHub, then I would suggest to take this up with their support team, who may be able to propose a workaround (or even better, contribute to fixing this issue).



2023-09-18 13:21

reporter   ~0068119

Hello @dregad, thank you for your very reasonable answer. Unfortunately Mantishub is not offering other plugins and referred me to you for a fix, so I don't really expect any help from them. I totally understand how a bug like this can be hard to fix for all scenarios, and that your time is limited; this is free software after all. We'll just go old-school for now .. or live with it.

Many thanks for all your efforts.



2023-09-18 15:19

reporter   ~0068120

I don't use MantisBT any more. I stopped along time ago. I now use WordPress / bbPress with EnlighterJS plugin. EnlighterJS is fantastic code code blocks.



2023-09-18 15:39

reporter   ~0068121

@ajtruckle Well, we have used MantisBT for decades and it's a wonderful system. This bug is unfortunate but all software has bugs, we can't throw out the baby with the bathwater...

One thing that's unfortunate though, I thought getting MantisHub would support the developers in a small way and that doesn't seem to be the case, it's too bad.



2023-09-19 02:11

developer   ~0068122

Thanks for your understanding @avr, I appreciate the kind words.
@ajtruckle, sorry to see you go.

MantisHub is a private commercial initiative by Victor Boctor. It is not otherwise associated with the project, they are just building on top of the open-source software. The other developers are not getting anything from it at all.



2024-04-02 22:10

reporter   ~0068782

Many thanks, @dregad.

- During parsing, catch all <code> blocks and replace them with a hash value.

Elegant and instructive .



2024-04-03 02:11

developer   ~0068783

Thanks for your kind words, I appreciate but I must say that the credit mostly goes to @hotzeplotz.

Related Changesets

MantisBT: master 3aec6e68

2024-03-31 23:15


Committer: dregad

Details Diff
Clean up markdown processing

- Process input via Markdownparser and return the result, no further
text processing.
- During parsing, catch all <code> blocks and replace them with a hash
- After the markup is returned from Parsedown, apply mentions and links
- Restore the untouched <code> Blocks back in place.

Fixes 0034040, PR
Also fixes 0022315, 0022320, 0024241, 0024628, 0024810, 0022231, 0023738

Signed-off-by: Damien Regad <>
Affected Issues
0022231, 0022315, 0022320, 0023738, 0024241, 0024628, 0024810, 0034040, 0034393
mod - plugins/MantisCoreFormatting/MantisCoreFormatting.php Diff File
mod - plugins/MantisCoreFormatting/core/MantisMarkdown.php Diff File