diff options
-rw-r--r-- | html.c | 21 | ||||
-rw-r--r-- | html.h | 6 | ||||
-rw-r--r-- | man_html.c | 2 | ||||
-rw-r--r-- | mandoc.1 | 23 | ||||
-rw-r--r-- | mdoc_html.c | 2 |
5 files changed, 16 insertions, 38 deletions
@@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> + * Copyright (c) 2008, 2009, 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any @@ -108,11 +108,11 @@ static int print_escape(char); static int print_encode(struct html *, const char *, int); static void print_metaf(struct html *, enum mandoc_esc); static void print_attr(struct html *, const char *, const char *); -static void *ml_alloc(char *, enum htmltype); +static void *ml_alloc(char *); static void * -ml_alloc(char *outopts, enum htmltype type) +ml_alloc(char *outopts) { struct html *h; const char *toks[5]; @@ -126,7 +126,6 @@ ml_alloc(char *outopts, enum htmltype type) h = mandoc_calloc(1, sizeof(struct html)); - h->type = type; h->tags.head = NULL; h->symtab = mchars_alloc(); @@ -155,14 +154,14 @@ void * html_alloc(char *outopts) { - return(ml_alloc(outopts, HTML_HTML_4_01_STRICT)); + return(ml_alloc(outopts)); } void * xhtml_alloc(char *outopts) { - return(ml_alloc(outopts, HTML_XHTML_1_0_STRICT)); + return(ml_alloc(outopts)); } void @@ -494,16 +493,10 @@ print_otag(struct html *h, enum htmltag tag, for (i = 0; i < sz; i++) print_attr(h, htmlattrs[p[i].key], p[i].val); - /* Accommodate for XML "well-formed" singleton escaping. */ + /* Accommodate for "well-formed" singleton escaping. */ if (HTML_AUTOCLOSE & htmltags[tag].flags) - switch (h->type) { - case HTML_XHTML_1_0_STRICT: - putchar('/'); - break; - default: - break; - } + putchar('/'); putchar('>'); @@ -100,11 +100,6 @@ struct htmlpair { #define PAIR_HREF_INIT(p, v) PAIR_INIT(p, ATTR_HREF, v) #define PAIR_STYLE_INIT(p, h) PAIR_INIT(p, ATTR_STYLE, (h)->buf) -enum htmltype { - HTML_HTML_4_01_STRICT, - HTML_XHTML_1_0_STRICT -}; - struct html { int flags; #define HTML_NOSPACE (1 << 0) /* suppress next space */ @@ -128,7 +123,6 @@ struct html { struct tag *metaf; /* current open font scope */ enum htmlfont metal; /* last used font */ enum htmlfont metac; /* current font mode */ - enum htmltype type; /* output media type */ int oflags; /* output options */ #define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */ }; @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> + * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any @@ -233,7 +233,7 @@ This is the default. See .Sx ASCII Output . .It Fl T Ns Cm html -Produce strict CSS1/HTML-4.01 output. +Produce CSS1/HTML5 output. See .Sx HTML Output . .It Fl T Ns Cm lint @@ -265,9 +265,8 @@ Encode output in the UTF\-8 multi-byte format. See .Sx UTF\-8 Output . .It Fl T Ns Cm xhtml -Produce strict CSS1/XHTML-1.0 output. -See -.Sx XHTML Output . +This is a synonym for +.Fl T Ns Cm html . .El .Pp If multiple input files are specified, these will be processed by the @@ -320,7 +319,7 @@ which will normalise to \(>=60. .Ss HTML Output Output produced by .Fl T Ns Cm html -conforms to HTML-4.01 strict. +conforms to HTML5 using optional self-closing tags. .Pp The .Pa example.style.css @@ -328,7 +327,8 @@ file documents style-sheet classes available for customising output. If a style-sheet is not specified with .Fl O Ns Ar style , .Fl T Ns Cm html -defaults to simple output readable in any graphical or text-based web +defaults to simple output (via an embedded style-sheet) +readable in any graphical or text-based web browser. .Pp Special characters are rendered in decimal-encoded UTF\-8. @@ -471,15 +471,6 @@ to force a UTF\-8 locale. See .Sx Locale Output for details and options. -.Ss XHTML Output -Output produced by -.Fl T Ns Cm xhtml -conforms to XHTML-1.0 strict. -.Pp -See -.Sx HTML Output -for details; beyond generating XHTML tags instead of HTML tags, these -output modes are identical. .Sh ENVIRONMENT .Bl -tag -width MANPAGER .It Ev MANPAGER @@ -1529,7 +1520,7 @@ has no effect. .It Words aren't hyphenated. .El -.Ss HTML/XHTML Compatibility +.Ss HTML Compatibility .Bl -bullet -compact .It The diff --git a/mdoc_html.c b/mdoc_html.c index a9f880f6..fa9d1ba0 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> + * Copyright (c) 2008, 2009, 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any |