View Issue Details

IDProjectCategoryView StatusLast Update
0035217mantisbtmarkdownpublic2026-03-12 15:07
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version2.28.0Fixed in Version2.28.0 
Summary0035217: PHP 8.4 deprecation warnings in Parsedown 1.7.4
Description

Mantis issues the following warnings:

DEPRECATED: 'Parsedown::blockSetextHeader(): Implicitly marking parameter $Block as nullable is deprecated, the explicit nullable type must be used instead' in './mantis/vendor/erusev/parsedown/Parsedown.php' line 715

DEPRECATED: 'Parsedown::blockTable(): Implicitly marking parameter $Block as nullable is deprecated, the explicit nullable type must be used instead' in './mantis/vendor/erusev/parsedown/Parsedown.php' line 853

Additional Information

This has already been reported upstream: https://github.com/erusev/parsedown/pull/868

The PR has been merged several months ago, but to-date no new version of Parsedown has been released. Requested that in https://github.com/erusev/parsedown/issues/897

TagsPHP 8.4

Relationships

related to 0034415 closeddregad Update Parsedown library to 1.7.4 
related to 0035227 closedcommunity MantisBT is not compatible with Parsedown 1.8 
child of 0035216 closeddregad PHP 8.4 compatibility 

Activities

raspopov

raspopov

2024-12-30 13:28

reporter   ~0069627

Last edited: 2024-12-30 13:32

So the next version of MantisBT 2.28 will be with Parsedown 1.8?

Looks like MantisCoreFormatting plugin should be slightly updated:

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 }
...
dregad

dregad

2024-12-30 13:47

developer   ~0069628

So the next version of MantisBT 2.28 will be with Parsedown 1.8?

1.8, 2.0 or whatever they release next... Hoping they do it soon.

raspopov

raspopov

2025-01-06 09:48

reporter   ~0069639

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

raspopov

raspopov

2025-01-09 11:50

reporter   ~0069649

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.

We need to decide whether to rewrite the MantisBT plugin or fix Parsedown.

dregad

dregad

2025-01-09 12:20

developer   ~0069650

Thanks for testing.

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

As a side note, please note that this thread is about PHP 8.4 compatibility, not Parsedown 1.8 tests - it would be better to move this discussion to a new issue.

raspopov

raspopov

2025-01-11 08:07

reporter   ~0069659

I created 0035227, all notes here can be deleted.

P.S. I just now realised that MantisBT doesn't have a button to move notes to another ticket...

dregad

dregad

2025-01-11 09:50

developer   ~0069660

MantisBT doesn't have a button to move notes to another ticket

No it does not. That's not a very common use case. What you can do is Clone the issue, then you have the option to copy the bugnotes and set a relationship to the original issue.

image.png (40,243 bytes)   
image.png (40,243 bytes)   
dregad

dregad

2025-12-13 11:50

developer   ~0070681

Switching to community-maintained Parsedown fork https://github.com/parsedown/parsedown which recently released version 1.7.5 including PHP 8.4 compatibility fix.

dregad

dregad

2025-12-13 12:02

developer   ~0070682

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

Related Changesets

MantisBT: master da69045f

2025-12-29 18:43

dregad

Committer: community


Details Diff
Parsedown upgrade to 1.7.5 and switch to fork

The original erusev/parsedown repository has not seen any release since
2019, and the owner does not seem too eager to continue maintaining it.

We are switching to a community-maintained fork [1] which has a PHP 8.4
compatible release.

Fixes 0035217, PR https://github.com/mantisbt/mantisbt/pull/2164

[1]: https://github.com/parsedown/parsedown
Affected Issues
0035217
mod - composer.json Diff File
mod - composer.lock Diff File