summaryrefslogtreecommitdiff
path: root/components/help/converters/gnome-db2html2/sect-elements.c
diff options
context:
space:
mode:
authorAli Abdin <aliabdin@aucegypt.edu>2000-10-27 11:28:33 +0000
committerAli Abdin <rakholh@src.gnome.org>2000-10-27 11:28:33 +0000
commit60ebe8f604c69af473c09141d602397b9401739c (patch)
treef60e7953ba61e13ffa21395110cb50df12f2c24c /components/help/converters/gnome-db2html2/sect-elements.c
parentc849c68d6c4a4a972d2d09c4213c6534bae8f126 (diff)
downloadnautilus-60ebe8f604c69af473c09141d602397b9401739c.tar.gz
Added a 'base_path' to the Context struct (parse_file): Do some minimal
2000-10-27 Ali Abdin <aliabdin@aucegypt.edu> * components/help/converters/gnome-db2html2/gdb3html.[ch]: Added a 'base_path' to the Context struct (parse_file): Do some minimal parsing to get the base path from the provided filename on the command line. * components/help/converters/gnome-db2html2/sect-elements.c: * components/help/converters/gnome-db2html2/toc-elements.c: (sect_figure_end_element), (sect_inlinegraphic_start_element), (sect_infobox_start_element), (toc_artheader_end_element): Use 'file://' URIs on images (using base_path to get the path of the image). This means images should now work within SGML files. Should fix bug #3938
Diffstat (limited to 'components/help/converters/gnome-db2html2/sect-elements.c')
-rw-r--r--components/help/converters/gnome-db2html2/sect-elements.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/components/help/converters/gnome-db2html2/sect-elements.c b/components/help/converters/gnome-db2html2/sect-elements.c
index d8809510b..5c3948bef 100644
--- a/components/help/converters/gnome-db2html2/sect-elements.c
+++ b/components/help/converters/gnome-db2html2/sect-elements.c
@@ -1030,7 +1030,8 @@ sect_figure_end_element (Context *context,
if (sect_context->figure->id)
sect_print (context, "</A>");
sect_print (context, "</B><P>");
- sect_print (context, "<IMG SRC=\"%s\" ALT=\"%s\"><P>",
+ sect_print (context, "<IMG SRC=\"file://%s%s\" ALT=\"%s\"><P>",
+ context->base_path,
sect_context->figure->img,
(sect_context->figure->alt) ? sect_context->figure->alt : "IMAGE");
}
@@ -1080,19 +1081,19 @@ sect_inlinegraphic_start_element (Context *context,
/* FIXME: Should we put an 'ALT' tag here? */
if (format == NULL) {
/* Default is PNG */
- sect_print (context, "<IMG SRC=\"%s.png\">", fileref);
+ sect_print (context, "<IMG SRC=\"file://%s%s.png\">", context->base_path, fileref);
} else if (g_strcasecmp (format, "gif") == 0) {
- sect_print (context, "<IMG SRC=\"%s.gif\">", fileref);
+ sect_print (context, "<IMG SRC=\"file://%s%s.gif\">", context->base_path, fileref);
} else if ((g_strcasecmp (format, "jpg") == 0) ||
(g_strcasecmp (format, "jpeg") == 0)) {
/* Some people decide to use .jpg, others use .jpeg */
lowcaseformat = g_strdup (format);
g_strdown (lowcaseformat);
- sect_print (context, "<IMG SRC=\"%s.%s\">", fileref, lowcaseformat);
+ sect_print (context, "<IMG SRC=\"file://%s%s.%s\">", context->base_path, fileref, lowcaseformat);
g_free (lowcaseformat);
} else {
/* Unknown file format */
- sect_print (context, "<IMG SRC=\"%s.%s\">", fileref, format);
+ sect_print (context, "<IMG SRC=\"file://%s%s.%s\">", context->base_path, fileref, format);
}
}
@@ -1468,7 +1469,7 @@ sect_infobox_start_element (Context *context,
sect_print (context, "<TABLE BORDER=\"0\" WIDTH=\"100%%\">\n<tr><TD WIDTH=\"25%%\" ALIGN=\"CENTER\" VALIGN=\"TOP\">");
if (logo != NULL)
- sect_print (context, "<IMG ALT=\"%s\" SRC=\"%s\">", name, logo);
+ sect_print (context, "<IMG ALT=\"%s\" SRC=\"file://%s\">", name, logo);
else
sect_print (context, "%s", name);
sect_print (context, "<TH ALIGN=\"LEFT\" VALIGN=\"CENTER\"></TD>\n");