- Issue created by @jasonawant
- πΊπΈUnited States jasonawant New Orleans, USA
Regarding
Another observation related to BaseParser::parse() method is that when using the fallback filter_output render strategy type, all markup is stripped, including markdown converted to HTML b/c this occurs after the conversion here within BaseParser::parse().
,
the order could be swapped to first filter out user provided HTML before converting markdown into HTML.
This could be a separate issue.
- πΊπΈUnited States jasonawant New Orleans, USA
Ah, I think I figured out a work around.
Instead of invoking
\Drupal::service('markdown')->parse()
, which uses the default parser; l instantiated a parser by name with the parser's configuration. For example:drush php-eval "echo(\Drupal::service('markdown')->getParser('commonmark', Drupal::config('markdown.parser.commonmark')->getRawData())->parse('This is **BOLD**.'));"
This results in the expected output of
<p>This is <strong>BOLD</strong>.</p>
- First commit to issue fork.
- last update
over 1 year ago Build Successful - @g-brodiei opened merge request.
- Status changed to Needs review
over 1 year ago 2:03pm 23 October 2023 - πΉπΌTaiwan g-brodiei
I have encountered the same issue and scenario as OP, after looking into this code. I've made change to assure the renderStrategy string may be fetched from the correct source, whether it's from the Plugin Configuration or the settings object.
Settings to needs review.
- πΉπΌTaiwan g-brodiei
This should correct the behavior expected from the module's documentation β .