parse Doxygen commands if a previous block directive is being truncated #223
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.
Bug/issue #, if applicable: rdar://147921223
Summary
While Swift-Markdown has support for a limited number of Doxygen commands, the parsing logic for them has an error: When a previous block directive is present, even if it's not ready to parse content, the parser blocks Doxygen commands from being parsed. This prevents supported Doxygen commands from being parsed if they are immediately preceded by unsupported Doxygen commands, as the included test demonstrates.
This PR updates the parser logic to allow Doxygen commands to be parsed if the current state of the parser contains a block directive, so long as it is not accepting content.
Dependencies
None
Testing
To verify the behavior of the included test outside of the test harness, use the following "markdown" file:
Steps:
test.md.swift run --package-path Tools markdown-tool dump-tree --parse-block-directives --experimental-parse-doxygen-commands test.md@param,@return, and@discussioncommands correctly parse into their respective Doxygen command nodes.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/testscript and it succeeded