Escape ' at the beginning of lines
Cast ctype.h inputs to unsigned char
Fuckings to glibc, jesus christ that code was a nightmare
Read glibc's ctype.h and then compare it to musl's src/ctype/isalpha.c
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
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
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.
Fix regression with manual name check
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
disallow invalid name characters
This commit makes using invalid characters in the name a fatal error.
Before this patch, "foo | bar(1)" would parse as "foobar(1)". Now it is
a fatal error and parsing stops.
parse_text: return if next is UTF8_INVALID
In the underscore case, the next character is retrieved to check
whether the underscore is at a word break. However, if this character
is UTF8_INVALID, the call to parser_pushch will be a noop. This
results in the loop continuing on further than it should. This just
adds a check to see if next is UTF8_INVALID and returns if it is.
Signed-off-by: Brian Ashworth <firstname.lastname@example.org>
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
Replace localtime with gmtime
The localtime() function gives the time relative to the users time.
This makes the generated manpage non reproducible. gmtime() gives
the time as UTC.