Drop flex/bison from .build.yml
These were necessary for annotatec, which has been removed.
.build.yml: remove unused secret
.build.yml: drop annotations
Fix parsing of line breaks followed by underlined text
Fix parsing of line breaks without newline
Add basic working tests for line breaks parsing
Allow subsection in preamble
Subsections are useful in case on name conflicts within a section.
Typically man pages in distributions are using the 'p' subsection.
They are also needed for the man pages of wrapper commands for example.
Section needs to be explicitly defined
The absence of value between the section parentheses resulted in the
section being 0 (header files), which is unlikely to be the one wanted
Fix `date --date` dependent test
This test depends on a nonportable option for date(1). I am not sure
that there is a good portable way to do this, so I just directly
included the seconds since epoch that it would have computed. We're
testing scdoc, not testing the local system's date command.
Fix timezone-dependent tests
These tests fail depending on timezone and current time if the date
differs from the UTC date. This was remedied by using `date -u`, which
Expand preamble written to man page output
Replace str_t with struct str
tables: add expand options
fix bug preventing indented literal blocks
This commit fixes a bug in parsing indented literal blocks. For example:
This is a block
Prior to this commit, this would fail, but with an unexpected error
message: "Error at 4:3: Cannot deindent in literal block". The
indentation was being parsed at every character, so the parser saw the
`T`, then parsed indentation again. The indentation was 0 (since there
were no tab characters between the `T` and the `h`), but the block
started with an indentation level of 1. 0 < 1, so this would be
considered a dedent, which is not allowed.
This commit introduces a new local variable, `check_indent`, which
controls whether the parser tries to parse indentation or not; now
indentation is only parsed when the last character was a newline. From
my testing this seems to fix the issue - indented literal blocks are now
remove unnecessary `closed` variable in parse_list
This local variable was initialized to `false` and never set to true
anywhere in the function.