fix(parser): correct undefined
in summary subtopics with boundaries & summary handling with nested subtopics
#6
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.
Issue 1
Description
The XMindMark specification clearly states that subtopics of a Summary Topic can have Boundaries, as mentioned in the documentation:
However, when using this feature in practice, the following error occurs:
This indicates that the current implementation cannot properly handle boundary markers on Summary Topic subtopics.
Error Screenshot
Changes Made
mindmark.ts
that handles boundaries for Summary Topic subtopicsFixed Result
Unit Tests
Added unit test case to verify that boundaries can be correctly applied to Summary Topic subtopics:
Issue 2
Description
The XMindMark specification allows summary topics to have their own subtopics. However, the current implementation incorrectly adds the subtopics of a summary topic to the last processed regular topic, rather than to the summary topic itself. This causes incorrect structure in the map when attempting to create subtopics under a summary topic:
With the current implementation,
summarySubtopic 1
andsummarySubtopic 2
are incorrectly added as children ofsubtopic 1
instead of undersummary topic
.Error Screenshot
Changes Made
mindmark.ts
to correctly associate summary topic subtopics with their parent summary topiclevels
array when processing a summary topic, ensuring proper parent-child relationshipsThe key change was adding code to update the hierarchy levels after processing a summary topic:
Fixed Result
Unit Tests
Added unit test case to verify that subtopics are correctly added to summary topics: