From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o6N08wAk013751 for ; Thu, 22 Jul 2010 20:08:58 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id o6N08vm7016588; Thu, 22 Jul 2010 20:08:57 -0400 (EDT) Date: Thu, 22 Jul 2010 20:08:57 -0400 (EDT) Message-Id: <201007230008.o6N08vm7016588@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Add support for `Sm' in -T[x]html -mdoc. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Add support for `Sm' in -T[x]html -mdoc. Modified Files: -------------- mdocml: html.c html.h mdoc_html.c Revision Data ------------- Index: html.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.h,v retrieving revision 1.26 retrieving revision 1.27 diff -Lhtml.h -Lhtml.h -u -p -r1.26 -r1.27 --- html.h +++ html.h @@ -113,6 +113,7 @@ struct html { #define HTML_IGNDELIM (1 << 1) #define HTML_KEEP (1 << 2) #define HTML_PREKEEP (1 << 3) +#define HTML_NONOSPACE (1 << 4) struct tagq tags; struct ordq ords; void *symtab; Index: html.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.c,v retrieving revision 1.108 retrieving revision 1.109 diff -Lhtml.c -Lhtml.c -u -p -r1.108 -r1.109 --- html.c +++ html.c @@ -417,6 +417,9 @@ print_otag(struct html *h, enum htmltag printf(" "); } + if ( ! (h->flags & HTML_NONOSPACE)) + h->flags &= ~HTML_NOSPACE; + /* Print out the tag name and attributes. */ printf("<%s", htmltags[tag].name); @@ -544,7 +547,8 @@ print_text(struct html *h, const char *w assert(word); if ( ! print_encode(h, word, 0)) - h->flags &= ~HTML_NOSPACE; + if ( ! (h->flags & HTML_NONOSPACE)) + h->flags &= ~HTML_NOSPACE; /* * Note that we don't process the pipe: the parser sees it as Index: mdoc_html.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v retrieving revision 1.98 retrieving revision 1.99 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.98 -r1.99 --- mdoc_html.c +++ mdoc_html.c @@ -125,6 +125,7 @@ static int mdoc_pq_pre(MDOC_ARGS); static int mdoc_rs_pre(MDOC_ARGS); static int mdoc_rv_pre(MDOC_ARGS); static int mdoc_sh_pre(MDOC_ARGS); +static int mdoc_sm_pre(MDOC_ARGS); static int mdoc_sp_pre(MDOC_ARGS); static void mdoc_sq_post(MDOC_ARGS); static int mdoc_sq_pre(MDOC_ARGS); @@ -227,7 +228,7 @@ static const struct htmlmdoc mdocs[MDOC_ {NULL, NULL}, /* Sc */ {mdoc_sq_pre, mdoc_sq_post}, /* So */ {mdoc_sq_pre, mdoc_sq_post}, /* Sq */ - {NULL, NULL}, /* Sm */ /* FIXME - no idea. */ + {mdoc_sm_pre, NULL}, /* Sm */ {mdoc_sx_pre, NULL}, /* Sx */ {mdoc_sy_pre, NULL}, /* Sy */ {NULL, NULL}, /* Tn */ @@ -1715,6 +1716,23 @@ mdoc_fn_pre(MDOC_ARGS) print_text(h, ")"); if (MDOC_SYNPRETTY & n->flags) print_text(h, ";"); + + return(0); +} + + +/* ARGSUSED */ +static int +mdoc_sm_pre(MDOC_ARGS) +{ + + assert(n->child && MDOC_TEXT == n->child->type); + if (0 == strcmp("on", n->child->string)) { + /* FIXME: no p->col to check... */ + h->flags &= ~HTML_NOSPACE; + h->flags &= ~HTML_NONOSPACE; + } else + h->flags |= HTML_NONOSPACE; return(0); } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv