| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
* Not sure there were any text nodes, might have been other stuff instead.
* Not sure it was just one node, maybe several were deleted.
* No problem if some nodes were deleted, as long as some valid ones are left.
* We do not leave early, but after cleaning out all the crap.
* We are not "bailing", but we consider the block valid after cleanup.
|
|
|
|
|
|
|
|
| |
.Rs
plain text
.Re
This avoids a crash on invalid.
|
|
|
|
|
|
|
| |
and assert that print_bvspace cannot be called on NULL pointers.
No change in behaviour, none of these were bugs,
but the code becomes easier to understand.
Based on a clang report posted by joerg@; ok kristaps@.
|
| |
|
|
|
|
| |
Klausner.
|
|
|
|
|
| |
recognised. It's easier to make these u_int than to jump through hoops
for a special formatter.
|
|
|
|
|
|
| |
Originally pointed out by joerg@ then again by Thomas Klausner by way of
Nicolas Joy. Note: don't use these constructions as you can't link to
the sections with `Sx'.
|
|
|
|
|
| |
through looking for user-defined escapes. This clears up a nice bit of
validation code.
|
|
|
|
|
|
|
|
|
|
|
|
| |
That is to say, with mingw32. This amounts to the following:
(1) break compat.c into compat_strlcpy.c and compat_strlcat.c
(2) add compat_getsubopt.c (from OpenBSD) and test-getsubopt.c
(3) add test-strptime.c for HAVE_STRPTIME
(4) add ifdef bits here and there, where necessary
(5) remove some harmless unportable stuff (u_char, localtime_r)
I've added the appropriate mdocml.zip target to the Makefile, too.
|
|
|
|
|
| |
This is required for supporting in-line equations. While here, push
registers properly into roff and add an set/get/mod interface.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
prompted by a TODO by schwarze@, originally from Gleydson Soares, that
an empty `SS' was raising an error (it hasn't for some time). It makes
sense these shouldn't warn, as omitting their contents doesn't change
anything in the structure of the document (groff and mandoc specifically
account for the whitespace between empty sections).
This doesn't change any manuals, which only refer to the line arguments
(or possibly next-line, in the case of man(7) syntax).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a public (mandoc.h) function mandoc_escape(), which merges the
functionality of both prior functions.
Reason: code duplication. The a2roffdeco() and mandoc_special()
functions were pretty much the same thing and both quite complex. This
allows one function to receive improvements in (e.g.) subexpression
handling and performance, instead of having to replicate functionality.
As such, the mandoc_escape() function already handles a superset of the
escapes handled in previous versions and has improvements in performance
(using strcspn(), for example) and reliable handling of subexpressions.
This code Works For Me, but may need work to catch any regressions.
Since the benefits are great (leaner code, simpler API), I'd rather have
it in-tree than floating as a patch.
|
|
|
|
| |
non-zero. From a PR by Yuri Pankov, ok schwarze@.
|
|
|
|
|
| |
Don't have them do that (includes in header files = faugh), and have
individual files directly include these files.
|
|
|
|
|
|
|
|
|
| |
libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the
time being in libmandoc.h. This requires struct mparse to be passed
into the allocation routines instead of mandocmsg and a void pointer.
Then, move some of the functionality of the old mmsg() into read.c's
mparse_mmsg() (check against wlevel and setting of file_status) and use
main.c's mmsg() as simply a printing tool.
|
| |
|
|
|
|
|
| |
make mdoc_vmsg not return an int. libmdoc is now completely clean of
return-value checks from the message subsystem.
|
|
|
|
| |
only place that it's being used.
|
|
|
|
| |
place that it's being used.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
as a first step to get rid of the frequent petty warnings in this area:
- always store dates as strings, not as seconds since the Epoch
- for input, try the three most common formats everywhere
- for unrecognized format, just pass the date though verbatim
- when there is no date at all, still use the current date
Originally triggered by a one-line patch from Tim van der Molen,
<tbvdm at xs4all dot nl>, which is included here.
Feedback and OK on manual parts from jmc@.
"please check this in" kristaps@
|
|
|
|
| |
statements in the post-handler for EQN in -mdoc and -man.
|
|
|
|
|
| |
directives. For now this will just ignore them (except for -Ttree,
which just notes that an EQN's been accepted).
|
|
|
|
|
| |
shitty groff behaviour. Do the same, but raise a warning to this
effect. This from a TODO noted by schwarze@.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Most empty in_line() macros are already removed by the parser,
so there is no need to check again in mdoc_validate.c.
This also downgrades almost all remaining argument count issues
from ERROR to WARNING.
ok kristaps@
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Do not segfault on empty .Db, .Rs, .Sm, and .St.
* Let check_count() really throw the requested level, not always ERROR.
* Downgrade most bad argument counts from ERROR to WARNING.
* And some related internal cleanup.
Looks fine to kristaps@.
Note that the macros using eerr_ge1() still need to be checked at a later
time; but as all the others are done, let's use what we already have.
|
|
|
|
|
|
| |
external-facing function mdoc_addspan(), then various bits to prohibit
printing and scanning (this requires some if's to be converted into
switch's).
|
| |
|
|
|
|
|
| |
instead of underlined. This only happens in -Tascii, as -T[x]html both
underlines and italicises.
|
|
|
|
|
|
|
|
| |
favour of a simpler shim for normalised data in the node allocation and
free routines. This removes the need to bump and copy references within
validator handlers, removes a pointer redirect, and also kills the
refcount structure itself. Data is assumed to "live" either in a
MDOC_BLOCK or MDOC_ELEM and is copied accordingly.
|
|
|
|
|
| |
and .Lp should cause a warning, not an error.
"I don't suppose I mind this." kristaps@
|
|
|
|
|
|
|
| |
simplifies clean-up and allows for more types without extra hassle.
Also made in-line literal types in -T[x]html use CODE instead of SPAN to
match how literal blocks use PRE.
|
|
|
|
|
| |
the first step to having a simpler ref-counted system for "data"
associated with a node.
|
|
|
|
| |
study to see exactly what's legal and what's not.
|
|
|
|
| |
compact mode.
|
|
|
|
|
|
|
|
|
|
|
| |
`Bl' (before any `It' have been invoked). Next, have the existence of
either macro raise a warning, as it's technically not legal according to
mdoc.7.
Second, delete any `Pp' as the first element of a `Bl' (i.e., before an
`It') ONLY when -compact has not been specified. This matches with the
latest version of groff. This deletion happens prior to the above
check, so double-warnings will not be issued.
|
|
|
|
|
|
|
| |
Remove `Pp' or `Lp' if it is the FIRST or LAST child of an `Sh' or `Sh' body.
Make "skipping paragraph" be an error, not a warning, as information (an
invoked macro) is ignored.
|
|
|
|
|
|
|
|
|
| |
`Brq') to have zero arguments without warning. This makes sense because
the multi-line quote macros (`Oo/Oc' etc.) allow zero children anyway.
Furthermore, the documentation doesn't state that they're required to
have children.
Originally reported by Alex Kozlov, thanks!
|
| |
|
|
|
|
| |
NOARGV warnings. From patch by schwarze@.
|
| |
|
|
|
|
|
|
|
| |
making sure output doesn't add a superfluous newline with the nested displays.
Also add a COMPATIBILITY note.
Rename a macro (DATESIZ) to be in line with OpenBSD (DATESIZE).
|
|
|
|
| |
call to `Dl' or `Bd -literal' or unfilled.
|
|
|
|
|
|
|
|
|
|
| |
error printing, as this is superseded by exit_status in main.c.
Make check_argv() and check_text() return void.
Make MDOC_Std test in check_argv() to pre_std().
Re-write post_root() to check more conditions before returning.
|
|
|
|
| |
file is now ready for removal.
|
| |
|
|
|
|
| |
into mdoc_validate.c.
|