Skip to content

2.0.0#109

Merged
BenjaminHoegh merged 28 commits intomainfrom
dev
Jul 7, 2025
Merged

2.0.0#109
BenjaminHoegh merged 28 commits intomainfrom
dev

Conversation

@BenjaminHoegh
Copy link
Owner

Release 2.0.0 Highlights

  • Configuration overhaul – internal configuration handling was re‑architected for better performance and memory use
  • Emoji handling optimizations – emoji map is lazily loaded and cached; detection improved to check for emoji codes before loading the map
  • Inline parsing speedups – added early returns and regex simplifications in inline methods; keystroke and smartypants patterns streamlined
  • External link processing – refactored to minimize configuration checks and reduce per-link overhead
  • Checkbox handling – input element generation simplified for task lists
  • Table of Contents fixes – internal state reset after each parse to prevent data persistence across multiple parses
  • Numerous performance improvements and refactoring across the parser core

Removed Deprecated configuration keys

  • Removed abbreviations.allow_custom_abbr replaced by abbreviations.allow_custom
  • Removed abbreviations.predefine replaced by abbreviations.predefined
  • Removed emphasis.marking replaced by emphasis.mark
  • Removed headings.allowed replaced by headings.allowed_levels
  • Removed smarty replaced by smartypants
  • Removed smarty.substitutions.left-angle-quote replaced by smartypants.substitutions.left_angle_quote
  • Removed toc.toc_tag replaced by toc.tag
  • Removed markup replaced by allow_raw_html
  • Removed toc.headings replaced by toc.levels

BenjaminHoegh and others added 26 commits July 2, 2025 08:31
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…performance

Optimize smartypants handling
…or unkown reason it leaks data between while the same test outside of phpunit do not
@BenjaminHoegh BenjaminHoegh marked this pull request as ready for review July 7, 2025 21:17
Copilot AI review requested due to automatic review settings July 7, 2025 21:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the 2.0.0 release, overhauling the internal configuration system and optimizing multiple parsing paths.

  • Introduces a compiled configuration schema with bitmask-based feature flags and payloads.
  • Adds constructor overrides support and lazy-loading caches (emoji map, smartypants substitutions).
  • Updates tests to use renamed config keys (smartypants and headings.allowed_levels).

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/TypographerTest.php Renamed smarty config key to smartypants
tests/HeadingsTest.php Renamed headings.allowed config key to headings.allowed_levels
src/ParsedownExtended.php Bumped VERSION to 2.0.0; reworked constructor, config handling, inline parsers, removed deprecated methods, added early-return optimizations
Comments suppressed due to low confidence (2)

src/ParsedownExtended.php:1989

  • [nitpick] This TODO-style comment is vague. Either clarify the exact scenario or remove it if it's no longer accurate.
    // BUG: Breaks formatting if written in a single line

src/ParsedownExtended.php:181

  • You've introduced constructor overrides support but there are no tests covering it. Consider adding a unit test to verify overrides are applied correctly.
    public function __construct(array $overrides = [])

@BenjaminHoegh BenjaminHoegh merged commit 85665ee into main Jul 7, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants