summaryrefslogtreecommitdiffstats
path: root/html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-10 13:41:58 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-10 13:41:58 +0000
commite4c3f51da30c67c5fb30b0b90af2f55a8631af37 (patch)
tree16f9b89ca563ecf456a0ea40ebc31036c0afe0b4 /html.c
parent4787a4142e096d18cc8d1664421833e0e38bcb83 (diff)
downloadmandoc-e4c3f51da30c67c5fb30b0b90af2f55a8631af37.tar.gz
Sx to Sh anchors work.
Diffstat (limited to 'html.c')
-rw-r--r--html.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/html.c b/html.c
index 6cc0c41a..c6c406b2 100644
--- a/html.c
+++ b/html.c
@@ -764,6 +764,25 @@ html_inlinetagargs(struct md_mbuf *mbuf,
return(0);
switch (tok) {
+ case (ROFF_Sh):
+
+ /* FIXME: use API in ml.h. */
+
+ assert(*argv);
+ if ( ! ml_nputs(mbuf, " name=\"", 7, res))
+ return(0);
+ if ( ! ml_putstring(mbuf, *argv++, res))
+ return(0);
+ while (*argv) {
+ if ( ! ml_putstring(mbuf, "_", res))
+ return(0);
+ if ( ! ml_putstring(mbuf, *argv++, res))
+ return(0);
+ }
+ if ( ! ml_nputs(mbuf, "\"", 1, res))
+ return(0);
+ break;
+
case (ROFF_Sx):
/* FIXME: use API in ml.h. */
@@ -771,10 +790,17 @@ html_inlinetagargs(struct md_mbuf *mbuf,
assert(*argv);
if ( ! ml_nputs(mbuf, " href=\"#", 8, res))
return(0);
- if ( ! ml_putstring(mbuf, *argv, res))
+ if ( ! ml_putstring(mbuf, *argv++, res))
return(0);
+ while (*argv) {
+ if ( ! ml_putstring(mbuf, "_", res))
+ return(0);
+ if ( ! ml_putstring(mbuf, *argv++, res))
+ return(0);
+ }
if ( ! ml_nputs(mbuf, "\"", 1, res))
return(0);
+
break;
default:
break;
@@ -791,6 +817,8 @@ html_inlinetagname(struct md_mbuf *mbuf,
{
switch (tok) {
+ case (ROFF_Sh):
+ return(html_stput(mbuf, HTML_TAG_A, res));
case (ROFF_Pp):
return(html_stput(mbuf, HTML_TAG_DIV, res));
case (ROFF_Sx):