Fix nested BBCode quote handling in BbcodeToDjot converter #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes nested
[quote]tag handling inBbcodeToDjotconverter and improves quote attribution formatting.Changes
1. Fix Nested Quotes
The previous regex-based approach failed on nested quotes because
.*?(non-greedy) matches to the first[/quote]regardless of nesting depth. Replaced with depth-tracking parser.2. Proper Djot Caption Syntax
Changed from inline
*Author wrote:*to proper Djot caption syntax (^ Author) which renders as<figcaption>.3. Parse Quote Attributes
Extract ID, name, date/time from various BBCode quote formats:
[quote=John]^ John[quote=John date="2024-01-01"]^ John (2024-01-01)[quote=John date="2024-01-01" time="12:30"]^ John (2024-01-01 12:30)[quote="9" name="admin" date="2024-01-01 12:30"]^ admin (2024-01-01 12:30) #9[quote id="42" name="user" date="2024-01-01"]^ user (2024-01-01) #424. PHPStan Fixes
Fixed redundant
$depth > 0comparisons.Test Plan