Repository navigation
Fix ManFileParser to support asciidoctor == section syntax - #684
Open
tristantarrant wants to merge 1 commit into
Open
tristantarrant wants to merge 1 commit into
tristantarrant wants to merge 1 commit into
Conversation
This commit fixes ManFileParser to properly conform to the asciidoctor manpage specification, particularly for section heading formats. Changes: - ManSection.java: Added support for "== Section" syntax (standard asciidoctor format) while maintaining backward compatibility with the underline format (Section\n-----) - ManFileParser.java: Fixed header validation to support both "= title" and "title\n====" formats, and properly validate :doctype: manpage attribute - Added comprehensive test suite (ManFileParserTest.java) with 19 test cases covering both formats - Added test resources for == syntax, minimal headers, and mixed formats The parser now supports: 1. Standard == section syntax: == SECTION 2. Legacy underline syntax: SECTION\n------- 3. Both title formats: = title(1) and title(1)\n======= 4. Proper doctype validation All 19 tests pass, maintaining full backward compatibility with existing man page files. Fixes aeshell#683 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR fixes
ManFileParserto properly conform to the asciidoctor manpage specification, particularly for section heading formats.Fixes #683
Problem
The current implementation only supports the underline section format:
According to the asciidoctor spec, manpage sections should use the standard AsciiDoc heading syntax:
This meant that all standard asciidoctor manpage files using
==section syntax failed to parse.Changes
ManSection.java
== Sectionsyntax (standard asciidoctor format)Section\n-----)ManFileParser.java
= titleandtitle\n====formats:doctype: manpageattributeTest Suite
ManFileParserTest.javawith 19 test cases==section syntax parsingTest Resources
asciitest3_with_equals.txt- Complete manpage using== SECTIONsyntaxasciitest4_minimal.txt- Minimal valid manpage headerasciitest5_mixed_format.txt- Mixed==and underline formatsBackward Compatibility
✅ Full backward compatibility maintained
Test Results
🤖 Generated with Claude Code