Skip to content

feat: implement configurable markdown parser options#299

Merged
rochacbruno merged 6 commits intomainfrom
feat/configurable-markdown-parser
Jul 21, 2025
Merged

feat: implement configurable markdown parser options#299
rochacbruno merged 6 commits intomainfrom
feat/configurable-markdown-parser

Conversation

@rochacbruno
Copy link
Copy Markdown
Owner

@rochacbruno rochacbruno commented Jul 20, 2025

Summary

  • Add support for configuring markdown parser options via marmite.yaml configuration file
  • All comrak parser options are now configurable including render, parse, and extension settings
  • Backward compatible - sites without config use default settings
  • Partial configuration support - only specify options to change
  • Security enhancement - can disable unsafe HTML rendering

Implementation Details

  • New ParserOptions struct with render, parse, and extension options
  • Added markdown_parser field to Marmite config struct
  • Updated get_html function to use configurable options while maintaining backward compatibility
  • Added comprehensive documentation with examples and security considerations

Test plan

  • Verify backward compatibility with existing sites
  • Test partial configuration works correctly
  • Validate security options (unsafe HTML disable)
  • Confirm all parser extensions can be toggled
  • Documentation example added to example/content
  • Code formatting and clippy checks pass

Resolves #298
Closes #195

🤖 Generated with Claude Code

rochacbruno and others added 6 commits July 20, 2025 23:52
Add support for configuring markdown parser options via marmite.yaml
configuration file. All comrak parser options are now configurable
including render, parse, and extension settings.

Key features:
- New ParserOptions struct with render, parse, and extension options
- Backward compatible - sites without config use default settings
- Partial configuration support - only specify options to change
- Security enhancement - can disable unsafe HTML rendering
- Fine-grained control over markdown features

Resolves #298

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The get_html function is kept for backward compatibility as a public API,
even though internally we now use get_html_with_options.
Add configurable support for wikilinks with title after pipe syntax
from Comrak ExtensionOptions. This allows users to enable/disable
this specific wikilink variant independently from title before pipe.

- Add wikilinks_title_after_pipe field to ExtensionOptions
- Update parser to use the new option
- Add documentation for the new option
@rochacbruno rochacbruno merged commit e607a16 into main Jul 21, 2025
3 checks passed
@rochacbruno rochacbruno deleted the feat/configurable-markdown-parser branch July 21, 2025 11:48
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.

RFC: Configurable markdown parser options Support for Obsidian links with display text

1 participant