Render README.md on help page as HTML

Created on 15 April 2025, 22 days ago

Problem/Motivation

Currently, the help text for allow_only_one only seems to render the markdown wrapped in an

 tag. 



When the markdown module is enabled, the site gives a WSOD with this error:
Error: Call to undefined method League|CommonMark\Environment\Environment::setConfig() in Drupal|markdown|Plugin|Markdown|CommonMark|CommonMark->getEnvironment() (line 437 of /var/www/html/web/modules/contrib/markdown/src/Plugin/Markdown/CommonMark/CommonMark.php).

Steps to reproduce

To see the help text as unparsed markdown
  1. Install the Allow Only One module
  2. Go to the /admin/help/allow_only_one
  3. Confirm that the output is unparsed markdown
To see the WSOD
  1. Install the Allow Only One module
  2. run composer require league/commonmark
  3. Install the markdown module
  4. Go to the Markdown module configuration
  5. Confirm that a parser is active and set as the default
  6. Go to the /admin/help/allow_only_one
  7. Confirm that the site gives a WSOD
  8. Go to /admin/reports/dblog
  9. Confirm that there's this error: Error: Call to undefined method League|CommonMark\Environment\Environment::setConfig()

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States skyriter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @skyriter
  • I tried to reproduce the error locally, and it seems that the root cause is not in the Allow Only One module but rather in the Markdown module.

    More specifically, the issue comes from its CommonMark plugin, which was calling a deprecated method setConfig() from the league/commonmark library. This method was removed in version 2.3, which caused the WSOD (White Screen of Death) when accessing the help page.

    Here's the thread https://www.drupal.org/project/markdown/issues/3419098 πŸ› Call to undefined method League\CommonMark\Environment\Environment::setConfig() Needs review .

Production build 0.71.5 2024