Skip to content

Add markdown support - #196

Merged
iMattPro merged 7 commits into
phpbb-extensions:masterfrom
iMattPro:markdown
Aug 25, 2026
Merged

Add markdown support#196
iMattPro merged 7 commits into
phpbb-extensions:masterfrom
iMattPro:markdown

Conversation

@iMattPro

@iMattPro iMattPro commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Ads markdown support to Pages. Markdown can coexist with bbcodes, but not with HTML mode pages.

Use dedicated Litedown factory just for Pages

Fix up CSS
@codecov-commenter

codecov-commenter commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.62963% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.04%. Comparing base (daf55f2) to head (6b7264a).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
textformatter/factory.php 0.00% 9 Missing ⚠️
controller/admin_controller.php 0.00% 6 Missing ⚠️
entity/page.php 85.71% 4 Missing ⚠️
textreparser/plugins/pages_text.php 89.47% 2 Missing ⚠️
routing/route_cache.php 94.44% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #196      +/-   ##
============================================
+ Coverage     59.80%   62.04%   +2.23%     
- Complexity      228      264      +36     
============================================
  Files            18       21       +3     
  Lines           836      938     +102     
============================================
+ Hits            500      582      +82     
- Misses          336      356      +20     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

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 adds an opt-in Markdown pipeline for Pages content by introducing a Pages-scoped LiteDown-backed text formatter, persisting a page_content_markdown flag, and wiring ACP/UI + reparsing so Markdown pages can be stored/rendered without impacting regular forum posts.

Changes:

  • Add Pages-only Markdown parsing/rendering via a dedicated S9e/LiteDown formatter (textformatter/*) and opt-in storage flag (page_content_markdown) with migration.
  • Update Pages entity, ACP form, templates/CSS, and the Pages text reparser to support Markdown content end-to-end.
  • Add route-cache–only purge logic to avoid purging unrelated caches when Pages routes change, plus new/updated tests.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
textreparser/plugins/pages_text.php Adds page_content_markdown column support and reparsing path for Markdown pages.
textformatter/litedown.php Introduces Pages-scoped LiteDown parse/render wrapper using dedicated parser/renderer services.
textformatter/factory.php Ensures the Pages-only formatter configurator has LiteDown enabled.
tests/textformatter/litedown_test.php Adds unit tests for Pages LiteDown parse/render behavior and censor restoration.
tests/text_reparser/pages_text_test.php Updates reparser test to inject LiteDown dependency.
tests/routing/route_cache_test.php Adds unit test verifying route cache purge removes only compiled route artifacts.
tests/operators/page_operator_delete_page_test.php Updates entity construction to include LiteDown dependency.
tests/operators/page_operator_base.php Updates operator test base to provide LiteDown mock to the entity service.
tests/functional/pages_functional_base.php Extends functional helper to include parse_markdown form input.
tests/functional/cron_reparser_test.php Updates functional test content to Markdown and validates parsed output remains after reparsing.
tests/functional/admin_controller_test.php Adds functional coverage that Markdown is opt-in for Pages and isolated from forum posts.
tests/entity/page_entity_insert_test.php Updates expected inserted entity data to include page_content_markdown.
tests/entity/page_entity_content_test.php Adds coverage for Markdown/HTML exclusivity and LiteDown usage on Markdown content.
tests/entity/page_entity_base.php Updates entity test base to inject LiteDown mock and fixture import data with markdown flag.
tests/controller/page_main_controller_test.php Updates controller tests to construct entity with LiteDown dependency.
styles/prosilver/theme/pages_controller.css Adjusts Pages styling to better normalize LiteDown-generated block elements and adds pages-postbody.
styles/prosilver/template/pages_default.html Wraps Pages content in a postbody container for consistent styling.
styles/prosilver/template/pages_blank.html Wraps blank template content in a postbody container for consistent styling.
routing/route_cache.php Adds a targeted purge for compiled route matcher/generator files (and opcache invalidation).
migrations/v30x/m11_markdown.php Adds DB schema migration to introduce page_content_markdown column.
language/en/pages_acp.php Updates ACP text to mention Markdown and adds label for Markdown parsing option.
entity/page.php Adds Markdown flag handling, LiteDown injection, and Markdown parse/render branches in content flow.
entity/page_interface.php Extends entity interface with Markdown enable/disable/query methods.
controller/admin_controller.php Adds ACP support for parse_markdown and switches to targeted route cache purge.
config/services.yml Registers route cache + Pages-only parser/renderer/factory/LiteDown services and injects LiteDown where needed.
adm/style/manage_pages.html Adds ACP checkbox to opt into Markdown parsing for Pages content.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread textformatter/litedown.php
Comment thread textformatter/litedown.php Outdated
Comment thread entity/page.php
Comment thread tests/text_reparser/pages_text_test.php
Comment thread tests/operators/page_operator_base.php
Comment thread tests/entity/page_entity_base.php
Comment thread tests/controller/page_main_controller_test.php
@iMattPro
iMattPro requested review from rxu and a lite review from Copilot August 25, 2026 00:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Comment thread textreparser/plugins/pages_text.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.

@iMattPro
iMattPro merged commit 6793421 into phpbb-extensions:master Aug 25, 2026
35 checks passed
@iMattPro
iMattPro deleted the markdown branch August 25, 2026 16:25
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.

3 participants