Disallows differing row lengths in table
scdoc will now fail if the rows in a table don't all have the same
length. A test has also been added to check this behavior, and scdoc(5)
has been updated to clarify the behavior.
Signed-off-by: Sebastian <firstname.lastname@example.org>
Suppress sentence spacing after end-of-sentence characters.
This should fix the inconsistent spacing issue mentioned in . I also
fixed a spacing in issue in the man page.
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
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
enforce 1-step indentation
Allow multi-step indentation in literal blocks, and allow multi-step
Revert "fix enforcement of 1-step indentation"
This reverts commit 8c537aa2956a55fe341e1d48110ae6985ada7e5f.
fix enforcement of 1-step indentation
Fix SOURCE_DATE_EPOCH test w/busybox date
Fix the "Ignores underscores in underlined words" test
The test produced the following output:
Ignores underscores in underlined words test/inline-formatting: line 26: end0: not found
fix underscores in underlined words
Currently, the first underscore encountered while underlining ends
underlining. As a result, underscores in underlined words are not
ignored e.g. _hello_world_ does not parse correctly.
This checks the next character to see if it is still in a word before
Use a more robust approach for in-word-underscores
Test for empty table cells
Support $SOURCE_DATE_EPOCH for reproducible man pages
The environment variable SOURCE_DATE_EPOCH  is standardized and can
be used to produce reproducible output. Distributions like Debian will
set this variable before the build and scdoc should use it (instead of
the current date) for any timestamps within the man pages.