-
-
Notifications
You must be signed in to change notification settings - Fork 1
Use config service to customize markdown parser behavior #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add 'markdown' configuration section to default.php - Update MarkdownService to use config values instead of empty array - Add comprehensive tests for MarkdownService configuration - Remove completed TODO from MarkdownService.php Co-authored-by: lcharette <[email protected]>
Co-authored-by: lcharette <[email protected]>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
| $environment = new Environment([]); | ||
| // Get markdown configuration from config service | ||
| $markdownConfig = $config->get('markdown', []); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Remove empty spaces here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Removed trailing whitespace in commit 5d6f54c.
Address code review feedback to remove empty spaces on line 39 Co-authored-by: lcharette <[email protected]>
Implementation Complete: Markdown Service Configuration
This PR successfully addresses the TODO in
packages/sprinkle-core/app/src/ServicesProvider/MarkdownService.phpto use the config service to customize the markdown parser behavior.✅ Implementation Checklist
📝 Changes Summary
4 files changed: 167 insertions(+), 2 deletions(-)
1. Configuration Added (
packages/sprinkle-core/app/config/default.php)markdownconfiguration section with sensible defaults for CommonMark v2.7html_input(default: 'strip') - Controls HTML handling in markdown (strip/escape/allow)allow_unsafe_links(default: false) - Security setting for link validationmax_nesting_level(default: 100) - Prevents excessive nesting attacks2. Service Updated (
packages/sprinkle-core/app/src/ServicesProvider/MarkdownService.php)markdownconfig from Config service:$config->get('markdown', [])3. Tests Added (
packages/sprinkle-core/app/tests/Unit/ServicesProvider/MarkdownServiceTest.php)4. Documentation Updated (
packages/sprinkle-core/CHANGELOG.md)🔒 Security Considerations
html_input: stripsetting✨ Technical Highlights
📚 Usage Example
Users can now customize markdown parser behavior in their config files:
Original prompt
Created from VS Code via the GitHub Pull Request extension.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.