Repository navigation
v1.2.0 - Metadata Comments Support for Basic Parser
π New Features
Metadata Comments Support in Basic Parser
- β Smart Detection: Basic Parser now automatically detects metadata comments and switches processing modes
- β Hybrid Performance: Fast path (~0.9ms) for simple documents, enhanced path (~3.4ms) for metadata comments
- β
Full Compatibility: Uses same
processMetadataCommentsutility as Enhanced Parser for consistent behavior - β Backward Compatible: No API changes - existing code continues to work exactly the same
Documentation Corrections
- π§ Fixed Inaccurate Feature Matrix: Both parsers now correctly show full ADF block support
- π§ Corrected ADF Extensions: Basic Parser supports ALL ADF blocks (panel, expand, mediaSingle, mediaGroup), not just panels/expands
- π Updated Performance Notes: Clear explanation of hybrid processing behavior
π Performance Comparison
| Parser | Simple Documents | With Metadata Comments |
|---|---|---|
| Basic Parser | ~0.9ms (fast path) | ~3.4ms (enhanced path) |
| Enhanced Parser | ~3.4ms (always enhanced) | ~3.4ms (always enhanced) |
π Migration Guide
No migration needed! This is a fully backward-compatible enhancement.
For Existing Basic Parser Users
// Your existing code continues to work exactly the same
const parser = new MarkdownParser();
const adf = parser.parse(markdown); // Now supports metadata comments automatically!New Metadata Comments Support
const markdownWithMetadata = `
<!-- adf:heading textAlign="center" -->
# Centered Heading
<!-- adf:paragraph lineHeight="1.5" -->
This paragraph has custom line height.
`;
const parser = new MarkdownParser(); // Basic Parser now handles this!
const adf = parser.parse(markdownWithMetadata);
// Custom attributes are preserved: heading.attrs.textAlign === "center"π― What's Next
The Basic Parser now provides the best of both worlds:
- β‘ Lightning-fast performance for simple documents
- π¨ Full metadata comments support when needed
- π Automatic mode switching based on content
- π¦ Same feature parity as Enhanced Parser for ADF blocks
Choose Basic Parser for performance-critical applications that occasionally need metadata comments support.