| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* mdoc.c: blank lines outside literal mode are more similar to .sp than .Pp
* backslashes do not terminate macros; partial revert of mdoc.c 1.164;
the intention of that commit is fully achieved in roff.c
* mdoc_term.c: no need to list the same prototype twice
* mdoc_validate.c: drop .Pp before .sp just like .Pp before .Pp
* fix off-by-one found by jsg@ with parfait, OpenBSD term_ps.c 1.12
ok kristaps@
|
|
|
|
| |
macros within an unfilled or literal `Bd'.
|
| |
|
|
|
|
|
|
|
|
|
| |
a single one. This makes code auditing easier and cuts down on
bytesize.
I also removed some NOSPACE clauses that were handled implicitly by the
punctuation itself, e.g., a NOSPACE prior to printing ')', which in
term.c has its leading whitespace automatically suppressed.
|
|
|
|
|
| |
This from a TODO entry. Also stripped the superfluous NOSPACE, which is
handled in term_word() or print_text() anyway.
|
|
|
|
|
|
| |
corresponding TODO entry.
Also have the "." after an `Rs' block trigger inter-sentence spacing.
|
|
|
|
|
|
|
|
|
|
|
| |
than the column containing it, the TERMP_HANG flag is required,
but avoid the flag when we know that the HEAD is shorter,
because in that case, the flag might ruin the alignment.
Problem originally reported by jmc@, who also spotted a regression
in an earlier version of this patch.
"feel free to commit" kristaps@
|
|
|
|
|
|
|
| |
separated by only "and" while two or more are with ", and" for the last
author.
Also remove relevant TODO and add regression tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As Kristaps found out, i was wrong: .Bl -column phrases do not ignore
spacing rules for trailing punctuation in general. In particular,
- the rightmost column of a column list is unaffected
- columns terminated by the .Ta macro instead of a tab are unaffected
- columns ending in a blank are unaffected
Spacing rules for trailing punctuation are only ignored when the tab
follows the punctuation immediately, without a blank in between,
because then the combination of punctuation and tab is treated by roff
as a word, and the punctuation is not recognized as isolated.
The reason this doesn't work in mandoc is that in the special case
of .Bl -column (not in general!), mandoc treats tabs as word delimiters.
We either need to solve this differently, or call it a bug in roff.
|
|
|
|
|
| |
and render it just like normal text.
Minimal fix of a formatting bug in operator(7) reported by ray@.
|
|
|
|
| |
Behaviour ok'd by schwarze@.
|
|
|
|
|
|
| |
preserve blank lines in .Bd -literal,
both in the middle and at the end of the display
ok kristaps@
|
|
|
|
|
| |
displays to work as old groff shows them; however, new groff still does
some fancy shit.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
an .Nm block, and gets special handling (new line, indentation).
But .Nm in the middle of a line is just a normal in-line element,
so make sure it does NOT get the special handling.
Partly fixes the test(1) SYNOPSIS; indentation after "[" is still
excessive, which is an unrelated and more difficult issue.
Reminded of the problem by jmc@;
OK kristaps@.
|
|
|
|
|
|
| |
be converted into a symbol.
The `Pp' issue has also been fixed.
|
|
|
|
| |
`Sh'/`Ss'. Reported by Jason McIntyre.
|
|
|
|
|
|
|
| |
and not with a delay, after the next token. But be careful not to cause
leading white space at the beginning of a line or column.
In OpenBSD, improves chmod(1), ksh(1), tar(1), ps(1) and probably many more.
ok kristaps@ and tested by jmc@ and sobrado@
|
|
|
|
|
|
|
|
|
| |
roff_getstr() family of functions into roff.c with the "first_string"
directly in struct roff. Second, pre-process each line for reserved
words in libroff, splicing and re-running a line if it has one (this
allows defined symbols to be macros). Remove term.c's invocation of the
roff_getstrn() function. Removed function documentation in roff.3 and
added roff.7 `ds' documentation.
|
|
|
|
|
|
|
| |
allow end-of-line to break. This fixes the bad behaviour found when
macros within `Bk' never break.
"Excellent" schwarze@
|
|
|
|
|
| |
on those parts of the code and text that i have written as Kristaps is.
"fine with me" kristaps@
|
|
|
|
| |
the loops here and there to track down the MDOC_Column arguments.
|
| |
|
|
|
|
| |
pointer like the other data members, as there's no need to copy it around.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
copying on internals after modification. Even more importantly, if an
ENDBODY token is provided, it would have been impossible for post-change
copying of the data to take place in the BLOCK. This allows it to
happen by dint of pointers.
Also did some bikeshedding in mdoc_term.c: checking against enum type
and explicitly casting to the "post" function to void. This is for my
own readability.
|
|
|
|
|
|
|
| |
kristaps@ will do the missing HTML part soon.
"looks nicer" jmc@
"seems perfect to me" sobrado@
"slap it in" kristaps@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the Rostock mandoc hackathon and tested and polished since,
supporting constructs like:
.Ao Bo Ac Bc (exp breaking exp)
.Aq Bo eol Bc (imp breaking exp)
.Ao Bq Ac eol (exp breaking imp)
.Ao Bo So Bc Ac Sc (double break, inner before outer)
.Ao Bo So Ac Bc Sc (double break, outer before inner)
.Ao Bo Ac So Bc Sc (broken breaker)
.Ao Bo So Bc Do Ac Sc Dc (broken double breaker)
There are still two known issues which are tricky:
1) Breaking two identical explicit blocks (Ao Bo Bo Ac or Aq Bo Bo eol)
fails outright, triggering a bogus syntax error.
2) Breaking a block by two identical explicit blocks (Ao Ao Bo Ac Ac Bc
or Ao Ao Bq Ac Ac eol) still has a minor rendering error left:
"<ao1 <ao2 [bo ac2> ac1> bc]>" should not have the final ">".
We can fix these later in the tree, let's not grow this diff too large.
"get it in" kristaps@
|
|
|
|
|
|
|
|
| |
* do not print invalid arguments verbatim (no groffs prints them, either)
* do not trigger TERMP_PREKEEP twice
* do not die from invlid arguments (groff won't die, either)
* continue to ignore even valid arguments (just like groff)
ok kristaps@ on the previous version, before removing my last bug ;)
|
|
|
|
|
|
|
|
|
| |
passed in to libmdoc and libman.
Fix mdoc.3 and man.3 EXAMPLE sections to include regset.
Add MDOC_SYNPRETTY flag cueing front-end to nicely format certain values
as if SEC_SYNOPSIS were the current section.
|
|
|
|
| |
OK and one stylistic tweak by kristaps@.
|
|
|
|
| |
const struct regset pointer. No functionality.
|
|
|
|
|
|
|
|
| |
in mdoc_term.c and man_term.c down into term.c. This is still not
implemented in term.c, although stubs for width calculations are in
place. From now on, offset, rmargin, and other layout variables are
abstract screen widths. They will resolve to the the familiar values
for -Tascii but -Tps will eventually use points instead of chars.
|
| |
|
|
|
|
| |
-width is cached.
|
| |
|
|
|
|
|
|
| |
trickery because widths may be on-the-fly recalculated. I don't like
how these are split between mdoc_action.c and mdoc_validate.c, but for
the time being, it'll do.
|
|
|
|
|
| |
to 6n if no value is specified" and added regression tests for `Bl'
testing against the empty -offset argument.
|
|
|
|
|
| |
obviously, which was causing fallout) and again remove the loop code.
Tested more thoroughly.
|
|
|
|
| |
scanning the argv list in print_bvspace(), and thus the parent pointer.
|
|
|
|
| |
cached values. You can probably guess where this is going.
|
|
|
|
|
|
| |
the "data" union in mdoc_node. Allows me to remove some ugly loops in
the front-end and duplicate tests in mdoc_action.c. Add a regression
test to make sure we're not doing anything bad (more to come).
|
|
|
|
|
|
|
|
|
|
|
| |
only calculated once in mdoc_validate.c.
Noted that `Bd -file xxx' is not supported: it now raises a fatal
warning. This is noted in mdoc.7.
Empty `Bd' now defaults to LIST_ragged, which is not quite what groff
does, but close enough (gross just throws away the `Bd' and gets upset
when it encounters an `Ed').
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the title line uses special characters, mandoc will segfault.
Thus, first set up the character tables, then print the header,
as we always did.
Found in OpenBSD /usr/src/usr.sbin/bind/bin/check/named-checkconf.8.
While here, set p->tabwidth in terminal_man() for symmetry
with terminal_mdoc(), as suggested by millert@ (and already
committed to OpenBSD earlier). Since 5 is the default, this
is not strictly required, but it is certainly clearer and more
robust.
"looks fine" kristaps@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
output. This is more tricky than you may think: we can't just call the
header function out-of-state (i.e., before a flushln has occured)
because we'd clobber our current state. Thus, we call at the beginning
and dump the output into an auxiliary buffer.
For the record, I don't think there's any other clean way to do this.
The only other Way That Works is to copy-aside *all* termp state, zero
it, and do the necessary headf/footf. This is just as complex, as
memory needs to be alloc'd and free'd per margin.
Unfortunately, this prohibits page numbering (the margin is only printed
once), so I'll probably end up re-writing this down the line.
|
|
|
|
|
|
| |
within term.c, but does add a small shim over putchar() that switches on
the output engine. Prints, for this initial version, only monospace and
without font decorations. It's a start.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
inconsistent behaviour. In short:
Some macros are displayed differently in the SYNOPSIS
section, particularly Nm, Cd, Fd, Fn, Fo, In, Vt, and Ft.
All of these macros are output on their own line. If two
such dissimilar macros are pair-wise invoked (except for Ft
before Fo or Fn), they are separated by a vertical space,
unless in the case of Fo, Fn, and Ft, which are always
separated by vertical space.
Behaviour ok Jason McIntyre, ingo@. Fallout will be treated
case-by-case.
I had to clear out some regressions that were testing against groff's
stranger behaviours: these will now break, as we don't care about such
invocations.
Also removed the newline for `Cd' invocation in a non-SYNOPSIS context.
|
|
|
|
|
|
|
|
|
|
|
| |
Restore the blank line before .In in SYNOPSIS
except right after .Sh or right after another .In.
Even though Kristaps says SYNOPSIS blank-line handling
is still very much work in progress and more is probably needed,
this one is useful to keep in sync with OpenBSD.
"fine" kristaps@
|