CVS log for mandoc/mdoc_markdown.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.37 / (download) - annotate - [select for diffs], Tue Aug 10 12:55:03 2021 UTC (2 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6, HEAD
Changes since 1.36: +4 -2 lines
Diff to previous 1.36 (unified) to selected 1.17 (unified)

Support two-character font names (BI, CW, CR, CB, CI)
in the tbl(7) layout font modifier.

Get rid of the TBL_CELL_BOLD and TBL_CELL_ITALIC flags and use
the usual ESCAPE_FONT* enum mandoc_esc members from mandoc.h instead,
which simplifies and unifies some code.

While here, also support CB and CI in roff(7) \f escape sequences
and in roff(7) .ft requests for all output modes.  Using those is
certainly not recommended because portability is limited even with
groff, but supporting them makes some existing third-party manual
pages look better, in particular in HTML output mode.

Bug-compatible with groff as far as i'm aware, except that i consider
font names starting with the '\n' (ASCII 0x0a line feed) character
so insane that i decided to not support them.

Missing feature reported by nabijaczleweli dot xyz in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992002.
I used none of the code from the initial patch submitted by
nabijaczleweli, but some of their ideas.
Final patch tested by them, too.

Revision 1.36 / (download) - annotate - [select for diffs], Mon Jun 22 19:20:40 2020 UTC (3 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.35: +3 -1 lines
Diff to previous 1.35 (unified) to selected 1.17 (unified)

Because mandoc_aux.h and mandoc.h use __attribute__, all files that
include mandoc_aux.h or mandoc.h need to include config.h, too.
It is suspected that for example IRIX needs this, or it is likely
to throw errors in these files because the system compiler doesn't
understand __attribute__.
Issue reported by Kazuo Kuroi <kazuo at irixnet dot org>.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Apr 3 11:35:01 2020 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.34: +7 -5 lines
Diff to previous 1.34 (unified) to selected 1.17 (unified)

Remove some stray argument names from function prototypes,
for consistency with the dominant style used in mandoc.
No functional change.
Patch from Martin Vahlensieck <academicsolutions dot ch>.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Feb 27 01:43:52 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.33: +25 -13 lines
Diff to previous 1.33 (unified) to selected 1.17 (unified)

Introduce the concept of nodes that are semantically transparent:
they are skipped when looking for previous or following high-level
macros.  Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm
and .Tg, and man(7) .DT and .PD.  Use this concept for a variety
of improved decisions in various validators and formatters.

While here,
* remove a few const qualifiers on struct arguments that caused trouble;
* get rid of some more Yoda notation in the vicinity;
* and apply some other stylistic improvements in the vicinity.

I found this class of issues while considering .Tg patches from kn@.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Feb 20 00:29:16 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (unified) to selected 1.17 (unified)

bugfix: .Tg must be ignored completely in these output modes

Revision 1.32 / (download) - annotate - [select for diffs], Sun Jan 19 18:02:00 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (unified) to selected 1.17 (unified)

Introduce a new mdoc(7) macro .Tg ("tag") to explicitly mark a place
as defining a term.  Please only use it when automatic tagging does
not work.  Manual page authors will not be required to add the new
macro; using it remains optional.  HTML output is still rudimentary
in this version and will be polished later.

Thanks to kn@ for reminding me that i have been considering since
BSDCan 2014 whether something like this might be useful.  Given
that possibilities of making automatic tagging better are running
out and there are still several situations where automatic tagging
cannot do the job, i think the time is now ripe.

Feedback and no objection from millert@; OK espie@ inoguchi@ kn@.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Jul 1 22:56:24 2019 UTC (4 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (unified) to selected 1.17 (unified)

delete trailing whitespace and space-tab sequences; no code change;
patch from Michal Nowak <mnowak at startmail dot com>
who found these with git pbchk in the illumos tree

Revision 1.30 / (download) - annotate - [select for diffs], Sun Dec 30 00:49:55 2018 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.29: +10 -10 lines
Diff to previous 1.29 (unified) to selected 1.17 (unified)

Cleanup, no functional change:

The struct roff_man used to be a bad mixture of internal parser
state and public parsing results.  Move the public results to the
parsing result struct roff_meta, which is already public.  Move the
rest of struct roff_man to the parser-internal header roff_int.h.

Since the validators need access to the parser state, call them
from the top level parser during mparse_result() rather than from
the main programs, also reducing code duplication.

This keeps parser internal state out of thee main programs (five
in mandoc portable) and out of eight formatters.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Dec 15 19:30:26 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.28: +4 -1 lines
Diff to previous 1.28 (unified) to selected 1.17 (unified)

Several improvements to escape sequence handling.

* Add the missing special character \_ (underscore).
* Partial implementations of \a (leader character)
and \E (uninterpreted escape character).
* Parse and ignore \r (reverse line feed).
* Add a WARNING message about undefined escape sequences.
* Add an UNSUPP message about unsupported escape sequences.
* Mark \! and \? (transparent throughput)
and \O (suppress output) as unsupported.
* Treat the various variants of zero-width spaces as one-byte escape
sequences rather than as special characters, to avoid defining bogus
forms with square brackets.
* For special characters with one-byte names, do not define bogus
forms with square brackets, except for \[-], which is valid.
* In the form with square brackets, undefined special characters do not
fall back to printing the name verbatim, not even for one-byte names.
* Starting a special character name with a blank is an error.
* Undefined escape sequences never abort formatting of the input
string, not even in HTML output mode.
* Document the newly handled escapes, and a few that were missing.
* Regression tests for most of the above.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Dec 3 21:00:10 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.27: +11 -3 lines
Diff to previous 1.27 (unified) to selected 1.17 (unified)

In the validators, translate obsolete macro aliases (Lp, Ot, LP, P)
to the standard forms (Pp, Ft, PP) up front, such that later code
does not need to look for the obsolete versions.
This reduces the risk of incomplete handling.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Oct 25 01:32:40 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.26: +2 -1 lines
Diff to previous 1.26 (unified) to selected 1.17 (unified)

Implement the \f(CW and \f(CR (constant width font) escape sequences
for HTML output.  Somewhat relevant because pod2man(1) relies on this.
Missing feature reported by Pali dot Rohar at gmail dot com.

Note that constant width font was already correctly selected before
this when required by semantic markup.  Only attempting physical
markup with the low-level escape sequence was ineffective.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Aug 17 20:33:38 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +16 -9 lines
Diff to previous 1.25 (unified) to selected 1.17 (unified)

Remove more pointer arithmetic passing via regions outside the array
that is undefined according to the C standard.  Robert Elz <kre at
munnari dot oz dot au> pointed out i wasn't quite done yet.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Aug 16 13:54:06 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.24: +5 -2 lines
Diff to previous 1.24 (unified) to selected 1.17 (unified)

Implement the \*(.T predefined string (interpolate device name)
by allowing the preprocessor to pass it through to the formatters.
Used for example by the groff_char(7) manual page.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Apr 11 17:11:13 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (unified) to selected 1.17 (unified)

preserve comments before .Dd when converting mdoc(7) to man(7)
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>

Revision 1.23 / (download) - annotate - [select for diffs], Wed Jun 14 01:31:26 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_3, VERSION_1_14_2
Changes since 1.22: +13 -2 lines
Diff to previous 1.22 (unified) to selected 1.17 (unified)

implement the roff(7) \p (break output line) escape sequence

Revision 1.22 / (download) - annotate - [select for diffs], Tue May 30 16:31:29 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +13 -7 lines
Diff to previous 1.21 (unified) to selected 1.17 (unified)

fix formatting of intermediate punctuation in .Lk

Revision 1.21 / (download) - annotate - [select for diffs], Fri May 5 15:17:32 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.20: +4 -2 lines
Diff to previous 1.20 (unified) to selected 1.17 (unified)

Move .sp to the roff modules.  Enough infrastructure is in place
now that this actually saves code: -70 LOC.

Revision 1.20 / (download) - annotate - [select for diffs], Fri May 5 13:17:55 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +2 -6 lines
Diff to previous 1.19 (unified) to selected 1.17 (unified)

move .ll to the roff modules

Revision 1.19 / (download) - annotate - [select for diffs], Fri May 5 02:06:19 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.18: +5 -2 lines
Diff to previous 1.18 (unified) to selected 1.17 (unified)

Move handling of the roff(7) .ft request from the man(7)
modules to the new roff(7) modules.  As a side effect,
mdoc(7) now handles .ft, too.  Of course, do not use that.

Revision 1.18 / (download) - annotate - [select for diffs], Thu May 4 17:48:29 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +13 -7 lines
Diff to previous 1.17 (unified)

Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.

Revision 1.17 / (download) - annotate - [selected], Mon Apr 24 23:06:18 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +4 -4 lines
Diff to previous 1.16 (unified)

Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].

Revision 1.16 / (download) - annotate - [select for diffs], Mon Apr 17 12:53:29 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.15: +15 -4 lines
Diff to previous 1.15 (unified) to selected 1.17 (unified)

Fix handling of trailing punctuation in .Lk.
This macro is unusual in so far as trailing punction needs to remain
inside the scope because it must be inside, not after the display
of long URIs in terminal output mode.
Improves formatting of fw_update(1), help(1), less(1), sendbug(1),
acx(4), inet6(4), ipsec(4), oce(4), isakmpd.conf(5), afterboot(8),
release(8), traceroute(8).

Revision 1.15 / (download) - annotate - [select for diffs], Sat Mar 11 12:35:45 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.14: +49 -22 lines
Diff to previous 1.14 (unified) to selected 1.17 (unified)

In markdown, autolinks are dangerous.  Different compilers disagree
with respect to what constitutes a valid autolink, and if a compiler
deems an autolink invalid, the input turns into an unintended and
potentially harmful raw HTML tag.  So, never write autolinks.
Instead of <link>, write [link](link).
Instead of <addr>, write [addr](mailto:addr).

Issue pointed out by bentley@, who also agrees with the general
direction of the change.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Mar 8 19:23:43 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.13: +3 -10 lines
Diff to previous 1.13 (unified) to selected 1.17 (unified)

The CommonMark specification wants that opening parentheses
inside link destinations be escaped.
While here, remove the obsolete ESC_PAR.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Mar 8 18:17:21 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.12: +5 -1 lines
Diff to previous 1.12 (unified) to selected 1.17 (unified)

According to the CommonMark specification, backslash escapes
and markdown markup do not work inside code spans.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Mar 8 17:51:58 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (unified) to selected 1.17 (unified)

The CommonMark specification allows list markers fo the form "number) "
as well as "number. ", so escape closing parentheses after leading digits
to improve portability.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Mar 8 17:40:55 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.10: +4 -2 lines
Diff to previous 1.10 (unified) to selected 1.17 (unified)

Do not increment .Bl -enum list markers beyond two digits.
Otherwise, we would indent subsequent paragraphs less than
the CommonMark specification requires, harming portability.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Mar 8 15:08:36 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.9: +6 -2 lines
Diff to previous 1.9 (unified) to selected 1.17 (unified)

.Bl -column never gets blank lines between rows

Revision 1.9 / (download) - annotate - [select for diffs], Wed Mar 8 14:30:06 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.8: +8 -2 lines
Diff to previous 1.8 (unified) to selected 1.17 (unified)

Add a blank after ">" when quoting.
If is allowed by markdown syntax and more human-readable.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Mar 7 15:31:24 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.7: +23 -12 lines
Diff to previous 1.7 (unified) to selected 1.17 (unified)

Escape blanks at the end of markdown lines
such that they don't look like output line breaks.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Mar 7 14:04:08 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.6: +5 -9 lines
Diff to previous 1.6 (unified) to selected 1.17 (unified)

fix completely empty .Eo: no blank line wanted

Revision 1.6 / (download) - annotate - [select for diffs], Tue Mar 7 13:28:02 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.5: +12 -2 lines
Diff to previous 1.5 (unified) to selected 1.17 (unified)

fix spacing after empty .Fl

Revision 1.5 / (download) - annotate - [select for diffs], Tue Mar 7 13:09:27 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.4: +31 -2 lines
Diff to previous 1.4 (unified) to selected 1.17 (unified)

implement .An -split and -nosplit

Revision 1.4 / (download) - annotate - [select for diffs], Tue Mar 7 12:39:01 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.3: +7 -10 lines
Diff to previous 1.3 (unified) to selected 1.17 (unified)

Fix .In formatting in the SYNOPSIS:
No &zwnj; in the middle of **, please.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Mar 6 14:58:10 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.2: +13 -4 lines
Diff to previous 1.2 (unified) to selected 1.17 (unified)

URIs need different escaping; reported by reyk@

Revision 1.2 / (download) - annotate - [select for diffs], Sat Mar 4 21:41:29 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.1: +3 -5 lines
Diff to previous 1.1 (unified) to selected 1.17 (unified)

Remove a redundant condition in .%T handling, no functional change.
Found by jsg@ with scan-build.

Revision 1.1 / (download) - annotate - [select for diffs], Fri Mar 3 14:23:23 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Diff to selected 1.17 (unified)

new -mdoc -Tmarkdown output mode; OK millert@ reyk@ tb@;
thanks to reyk@ and to Vsevolod at FreeBSD for suggesting it

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb