Skip to content

removeRules does not correctly remove rules #18

Description

@peaklabs-dev

Tempest version

tempest/markdown 1.2

PHP version

8.5

Operating system

macOS

Reproduction

  1. Remove a rule like the DivRule::class and the parsed HTML still includes HTML produced by the rule
use Tempest\Markdown\Markdown;
use Tempest\Markdown\Rules\DivRule;

$markdown = new Markdown()->removeRules(DivRule::class);

echo $markdown->parse(":::alert\nThis is an important message!\n:::")->html;
  1. Output (should not have <div class="alert"></div>)
<p><div class="alert">This is an important message!
</div></p>

Possible cause

  • Many tokens rebuild their own rule set inside forToken(), which overrides the parser's configured ruleset.

Activity

  1. added theissue type on Aug 4, 2026
  2. brendt commented on Aug 5, 2026

    @brendt
    Member

    Yeah this is an issue. I actually need to look at extensibility as a whole, now that I've used the package in multiple projects. I'll look into this. If you have ideas, feel free to share them though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions