View Issue Details

IDProjectCategoryView StatusLast Update
0035227mantisbtmarkdownpublic2025-01-11 14:31
Reporterraspopov Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version2.27.0 
Summary0035227: MantisBT is not compatible with Parsedown 1.8
Description

It looks like the MantisCoreFormatting plugin should be updated a bit, because when using Parsedown 1.8 the following error is generated:

SYSTEM WARNING
'Undefined array key "name"' in '...plugins\MantisCoreFormatting\core\MantisMarkdown.php' line 152

Detailed error information
    Full path: ...plugins\MantisCoreFormatting\core\MantisMarkdown.php
    Line number: 152
Stack trace
#   Filename    Line    Class   Type    Function    Args
0   ...parsedown\Parsedown.php  1792    MantisMarkdown  ->  element     <array> { ['elements'] => <array> { [0] => <array> { ['text'] => 'Bug!' } }, ['autobreak'] => false }
Steps To Reproduce

Replace MantisBT vendor\erusev\parsedown\Parsedown.php 1.7.4 with a latest one 1.8.

Additional Information

PR: https://github.com/mantisbt/mantisbt/pull/2068

Another problem with Parsedown 1.8 is probably a bug in Parsedown... After figuring out how to run PHPUnit tests (and fixing them for the new version), I noticed that two PHPUnit tests failed:

 ✘ Process emails with process_urls·=·ON;·lorem·user@exmaple.com·ipsum
   ┐
   ├ Failed asserting that two strings are identical.
   ├ --- Expected
   ├ +++ Actual
   ├ @@ @@
   ├ -'<p>lorem <a href="mailto:user@exmaple.com">user@exmaple.com</a> ipsum</p>'
   ├ +'<p>lorem user@exmaple.com ipsum</p>'
   │
   │ mantisbt\plugins\MantisCoreFormatting\tests\MarkdownTest.php:119
   ┴
 ✘ Process emails with process_urls·=·ON;·user@exmaple.com
   ┐
   ├ Failed asserting that two strings are identical.
   ├ --- Expected
   ├ +++ Actual
   ├ @@ @@
   ├ -'<p><a href="mailto:user@exmaple.com">user@exmaple.com</a></p>'
   ├ +'<p>user@exmaple.com</p>'
   │
   │ mantisbt\plugins\MantisCoreFormatting\tests\MarkdownTest.php:119
   ┴

Further investigation revealed that Parsedown commit eb55e42 removed the use of the unmarkedText method, although the method itself remains and is not used anywhere else. The problem is that MantisBT uses this overloaded method to mark up an email without angle brackets.

TagsNo tags attached.

Relationships

related to 0035217 confirmed PHP 8.4 deprecation warnings in Parsedown 1.7.4 

Activities

dregad

dregad

2025-01-11 09:54

developer   ~0069661

Repeating my original comment from 0035217:0069650

Parsedown commit eb55e42 removed the use of the unmarkedText method, although the method itself remains and is not used anywhere else
We need to decide whether to rewrite the MantisBT plugin or fix Parsedown.

For starters I suggest reporting this upstream, and see if they consider it a bug or not.
We can decide what to do based on their response (if they respond).

raspopov

raspopov

2025-01-11 10:43

reporter   ~0069662

I addressed the issue to Parsedown: https://github.com/erusev/parsedown/issues/898

dregad

dregad

2025-01-11 14:31

developer   ~0069673

Great, thank you