summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--src/devices/grohtml/post-html.cpp38
-rw-r--r--tmac/s.tmac6
3 files changed, 48 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 01134661..9adb7ab6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2004-12-07 Gaius Mulley <gaius@glam.ac.uk>
+
+ Fix a bug with title handling in HTML.
+
+ * src/devices/grohtml/post-html.cpp (text_glob::is_nf,
+ text_glob::is_fi, text_glob::is_ce): Use strlen to compute string
+ length.
+ (html_printer::handle_tag_within_title): New function.
+ (html_printer::do_title): Use it.
+
+ * tmac/s.tmac (TL): Don't set `need_eo_tl'.
+ (cov*tl-au-print): Emit `.eo.tl' tag.
+
2004-12-05 Alejandro López-Valencia <dradul@etb.net.co>
* man/groff_char.man: Minor imrovements.
diff --git a/src/devices/grohtml/post-html.cpp b/src/devices/grohtml/post-html.cpp
index 3a7c12f5..a881cb67 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -694,7 +694,8 @@ int text_glob::is_eo_tl (void)
int text_glob::is_nf (void)
{
- return is_tag && (strncmp(text_string, "html-tag:.fi", 12) == 0) &&
+ return is_tag && (strncmp(text_string, "html-tag:.fi",
+ strlen("html-tag:.fi")) == 0) &&
(get_arg() == 0);
}
@@ -704,7 +705,8 @@ int text_glob::is_nf (void)
int text_glob::is_fi (void)
{
- return( is_tag && (strncmp(text_string, "html-tag:.fi", 12) == 0) &&
+ return( is_tag && (strncmp(text_string, "html-tag:.fi",
+ strlen("html-tag:.fi")) == 0) &&
(get_arg() == 1) );
}
@@ -723,7 +725,8 @@ int text_glob::is_eo_h (void)
int text_glob::is_ce (void)
{
- return is_tag && (strcmp(text_string, "html-tag:.ce") == 0);
+ return is_tag && (strncmp(text_string, "html-tag:.ce",
+ strlen("html-tag:.ce")) == 0);
}
/*
@@ -732,7 +735,8 @@ int text_glob::is_ce (void)
int text_glob::is_in (void)
{
- return is_tag && (strncmp(text_string, "html-tag:.in ", strlen("html-tag:.in ")) == 0);
+ return is_tag && (strncmp(text_string, "html-tag:.in ",
+ strlen("html-tag:.in ")) == 0);
}
/*
@@ -741,7 +745,8 @@ int text_glob::is_in (void)
int text_glob::is_po (void)
{
- return is_tag && (strncmp(text_string, "html-tag:.po ", strlen("html-tag:.po ")) == 0);
+ return is_tag && (strncmp(text_string, "html-tag:.po ",
+ strlen("html-tag:.po ")) == 0);
}
/*
@@ -750,7 +755,8 @@ int text_glob::is_po (void)
int text_glob::is_ti (void)
{
- return is_tag && (strncmp(text_string, "html-tag:.ti ", strlen("html-tag:.ti ")) == 0);
+ return is_tag && (strncmp(text_string, "html-tag:.ti ",
+ strlen("html-tag:.ti ")) == 0);
}
/*
@@ -2076,6 +2082,8 @@ class html_printer : public printer {
void handle_state_assertion (text_glob *g);
void do_end_para (text_glob *g);
int round_width (int x);
+ void handle_tag_within_title (text_glob *g);
+
// ADD HERE
public:
@@ -2208,6 +2216,20 @@ void html_printer::emit_raw (text_glob *g)
}
/*
+ * handle_tag_within_title - handle a limited number of tags within
+ * the context of a table. Those tags which
+ * set values rather than generate spaces
+ * and paragraphs.
+ */
+
+void html_printer::handle_tag_within_title (text_glob *g)
+{
+ if (g->is_in() || g->is_ti() || g->is_po() || g->is_ce() || g->is_ll()
+ || g->is_fi() || g->is_nf())
+ troff_tag(g);
+}
+
+/*
* do_center - handle the .ce commands from troff.
*/
@@ -2353,6 +2375,7 @@ void html_printer::do_title (void)
title.has_been_found = TRUE;
return;
} else if (t->is_a_tag()) {
+ handle_tag_within_title(t);
page_contents->glyphs.sub_move_right(); /* move onto next word */
removed_from_head = ((!page_contents->glyphs.is_empty()) &&
(page_contents->glyphs.is_equal_to_head()));
@@ -2369,7 +2392,8 @@ void html_printer::do_title (void)
removed_from_head = ((!page_contents->glyphs.is_empty()) &&
(page_contents->glyphs.is_equal_to_head()));
}
- } while ((! page_contents->glyphs.is_equal_to_head()) || (removed_from_head));
+ } while ((! page_contents->glyphs.is_equal_to_head()) ||
+ (removed_from_head));
}
}
}
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 4fb432aa..33b60c36 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -179,7 +179,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.ll (u;\\n[LL]*5/6)
.nr cov*n-au 0
.HTML-TAG-NS ".tl"
-.nr need_eo_tl 1
..
.de @AU
.par@reset
@@ -381,7 +380,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.rs
.sp 3
.ce 9999
-.if d cov*tl-div .cov*tl-div
+.if d cov*tl-div \{\
+. cov*tl-div
+. HTML-TAG-NS ".eo.tl"
+.\}
.nr cov*i 1
.nr cov*sp 1v
.while \\n[cov*i]<=\\n[cov*n-au] \{\