Issue with Highlight Syntax in Markdown Field Plugin

Hi,

I’m using the Markdown Field Kirby CMS plugin and am having trouble with the highlight feature. Despite configuring the plugin as described, the ==highlight== syntax isn’t rendering correctly.

Configuration Details:

Blueprint (YML):

title: Home page
sections:
  fields:
    type: fields
    fields:
      statament:
        label: 
          en: Statement
          es: Llamada inicial
          pt: Abertura
          it: Chiamata 
        type: markdown
        buttons:
          - highlight

Template:

<?php snippet('header') ?>
<div class="main">
    <section class="statament">
        <?php if ($page->statament()->isNotEmpty()): ?>
            <div class="statament-txt">
                <?= $page->statament()->kt() ?>
            </div>
        <?php endif ?>
        <div class="home-btn">
            <button>Problem</button>
            <button>Person</button>
            <button>Relation</button>
            <button>Product</button>
        </div>
    </section>
</div>
<?php snippet('footer') ?>

Config (config.php):

<?php
return [
    'debug' => true,
    'markdown' => [
        'extra' => true
    ],
    'languages' => true,
    'languages.detect' => true,
    'languages' => [
        ['code' => 'en', 'name' => 'English', 'default' => true, 'url' => '/'],
        ['code' => 'es', 'name' => 'Español', 'url' => '/es'],
        ['code' => 'pt', 'name' => 'Português', 'url' => '/pt'],
    ],
];

The expected output should render ==highlight== as highlighted text, but it appears as plain text in the rendered HTML.

Notes:

  • I understand that the default Markdown parser might not support highlight, but the plugin documentation suggests it should handle this.
  • The plugin replaces Kirby’s default Markdown parser, but I’m still seeing the default behavior.

Has anyone encountered a similar issue or have suggestions for getting the highlight feature to work properly?

Thanks!

From the plugin docs:

  • highlight # textmarker (not supported by Kirby’s default markdown parser.)

So for me that means that you have to use another markdown parser than Parsedown for this to work.

Thanks, Sonja.

Yes, I understand. I installed league/commonmark and the n0sz/commonmark-marker-extension using a Kirby plugin. It’s working well for highlighting text.

this is my index.php plugin:

<?php

use Kirby\Cms\App as Kirby;
use League\CommonMark\CommonMarkConverter;
use N0sz\CommonMark\Marker\MarkerExtension;

require_once __DIR__ . '/../../../vendor/autoload.php';

Kirby::plugin('my/commonmark', [
    'components' => [
        'markdown' => function (Kirby $kirby, string $text = null, array $options = [], bool $inline = false) {
            $converter = new CommonMarkConverter();

            $environment = $converter->getEnvironment();
            
            $environment->addExtension(new MarkerExtension());

            return $converter->convertToHtml($text);
        }
    ]
]);