Issue Description
The regex patterns for HTML comments and markdown formatting in Validate-MarkdownFrontmatter.ps1 have limitations and could be enhanced.
File: scripts/linting/Validate-MarkdownFrontmatter.ps1
Line: 179
Problem
Current patterns:
$htmlCommentPattern = '<!--.*?-->'
$markdownFormatPattern = '(\*\*|__)(.*?)\1|(\*|_)(.*?)\3'
Limitations:
- HTML comment pattern doesn't handle multiline comments properly
- Markdown format pattern has backreference issues and doesn't cover all markdown syntax
Suggested Enhancement
$htmlCommentPattern = '(?s)<!--.*?-->'
$markdownFormatPattern = '(\*\*|__)([^*_]+?)\1|(\*|_)([^*_]+?)\3|\([^\`]+?\)'
(?s) enables multiline matching for HTML comments
- Non-greedy character classes prevent over-matching
- Added inline code pattern
Impact
- Severity: Low
- Enhancement to improve validation accuracy
- Not blocking current functionality
Source
Identified in PR #26 code review.
Issue Description
The regex patterns for HTML comments and markdown formatting in
Validate-MarkdownFrontmatter.ps1have limitations and could be enhanced.File:
scripts/linting/Validate-MarkdownFrontmatter.ps1Line: 179
Problem
Current patterns:
Limitations:
Suggested Enhancement
(?s)enables multiline matching for HTML commentsImpact
Source
Identified in PR #26 code review.