-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add auto_identifiers support to Man Reader #11675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+89
−21
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
7d4ed31
Man reader: add auto_identifiers support
smc181002 e06bf5c
Add tests for Man Reader with auto identifiers
smc181002 71fbfd3
Updated MANUAL.txt to include Man under auto_identifiers
smc181002 db13ea0
fixed spacing in Extensions.hs
smc181002 3b3bc70
Add NAME heading to pandoc-lua, pandoc-server man pages.
jgm 92aa560
Roff reader: handle `\` line continuation in table cells.
jgm 0b935b7
Translations: find lang-script type translations.
jgm ccf272b
Docx reader: improve treatment of tblHeader element.
jgm 428be28
Docx reader: fix bug in bitmask checking.
jgm 91a47d2
Error messages: use single quotes around paths and format names.
jgm a02b3bd
MANUAL: improve description of reference links.
jgm fa0cf76
HTML reader: parse aside as a Div.
jgm ae93b4f
Use latest citeproc.
jgm c94a324
Typst writer: add zero-width space before a Span label...
jgm 039663e
EPUB writer: support multiple EPUB versions for raw content (#11628).
vreoo 1137a2c
gridTable: fix calculation of column widths for default columns.
jgm 9e029d2
Use latest dev commonmark-hs.
jgm 2b93ecc
Fix cabal.project, stack.yaml (specify subdir).
jgm 28a6130
Docx writer: fix empty keywords in core document properties (#11666)
SAY-5 b7bf083
Man reader: better handling of .TP macro.
jgm 18f5c0b
Use MathJax v4 in default HTML templates.
jgm 83bbb1e
OpenDocument/ODT writer: use predefined styles. (#11672)
jgm 80b70b7
Markdown reader: allow grid tables to be indented. (#11671)
jolars 1ed849f
added auto_identifiers to existing tests
smc181002 06524d8
Moved tests for GFM and Ascii from Old tests to the command based tests
smc181002 4826003
Merge branch 'main' into issue-8852
smc181002 387234e
Updated old tests for man to use default auto_identifiers
smc181002 a9c2c02
Added reportLogMessages for logs from registerHeader
smc181002 fe0a68d
Replaced headerWith to header in tests without auto_identifiers
smc181002 55a5581
added tests for headers without auto_identifiers
smc181002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ another \ | |
| one;123456 | ||
| .TE | ||
| ^D | ||
| <h1>HEADING</h1> | ||
| <h1 id="heading">HEADING</h1> | ||
| <table> | ||
| <tbody> | ||
| <tr> | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| Github Formatted Markdown Identifiers | ||
| ``` | ||
| % pandoc -f man+gfm_auto_identifiers -t html | ||
| .TH "TEST" "1" "2026-05-08" "test v1.0.0" "test manual" | ||
| .SH 1st HEADING | ||
| .SH C++ & Rust | ||
| .SH HEADING | ||
| .SH HEADING | ||
| ^D | ||
| <h1 id="1st-heading">1st HEADING</h1> | ||
| <h1 id="c--rust">C++ & Rust</h1> | ||
| <h1 id="heading">HEADING</h1> | ||
| <h1 id="heading-1">HEADING</h1> | ||
| ``` | ||
|
|
||
| Ascii Identifiers test | ||
| ``` | ||
| % pandoc -f man+ascii_identifiers -t html | ||
| .TH "TEST" "1" "2026-05-08" "test v1.0.0" "test manual" | ||
| .SH Über den Flüssen | ||
| ^D | ||
| <h1 id="uber-den-flussen">Über den Flüssen</h1> | ||
| ``` | ||
|
|
||
| Headers without Auto Identifiers test | ||
| ``` | ||
| % pandoc -f man-auto_identifiers -t native | ||
| .TH "TEST" "1" "2026-05-08" "test v1.0.0" "test manual" | ||
| .SS Level 2 | ||
| .SS different styles: | ||
| .SS Ordered | ||
| .SS Ordered | ||
| ^D | ||
| [ Header | ||
| 2 ( "" , [] , [] ) [ Str "Level" , Space , Str "2" ] | ||
| , Header | ||
| 2 | ||
| ( "" , [] , [] ) | ||
| [ Str "different" , Space , Str "styles:" ] | ||
| , Header 2 ( "" , [] , [] ) [ Str "Ordered" ] | ||
| , Header 2 ( "" , [] , [] ) [ Str "Ordered" ] | ||
| ] | ||
| ``` |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that
registerHeaderdoesn't emit log messages directly withreport; it adds them to a list of log messages in state (usingaddLogMessage); to make sure that items in this list are actually output, you need to callreportLogMessagesafter parsing is finished. (I actually no longer remember why we had to do this indirect thing in the markdown reader, rather than usingreportdirectly, but there was some reasonregisterHeaderwas designed this way.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
registerHeaderwould not write any logs for Man State.Because
registerHeaderonly generates logs when there are duplicate identifiers.Logs generate in markdown when we have duplicate identifiers defined in markdown. But for Man, we do not have option for defining identifiers.
I can still add the
reportLogMessagesinParseManfunction if required.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. OK.