Add markdown support - #196
Conversation
Use dedicated Litedown factory just for Pages Fix up CSS
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.
Ads markdown support to Pages. Markdown can coexist with bbcodes, but not with HTML mode pages.