/*
- * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
+ * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
* Copyright (C) 2005 QSDN,Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
#include "chxj_qr_code.h"
#include "chxj_buffered_write.h"
#include "chxj_str_util.h"
+#include "chxj_header_inf.h"
#define GET_XHTML(X) ((xhtml_t*)(X))
#undef W_L
#define W_L(X) do { xhtml->out = BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, (X)); } while(0)
#define W_V(X) do { xhtml->out = (X) ? BUFFERED_WRITE_VALUE(xhtml->out, &doc->buf, (X)) \
: BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, ""); } while(0)
+#undef W_NLCODE
+#define W_NLCODE() do { char *nlcode = TO_NLCODE(xhtml->conf); W_V(nlcode); } while (0)
static char *s_xhtml_1_0_start_html_tag (void *pdoc, Node *node);
static char *s_xhtml_1_0_end_html_tag (void *pdoc, Node *node);
static char *s_xhtml_1_0_end_blink_tag (void *pdoc, Node *node);
static char *s_xhtml_1_0_start_marquee_tag (void *pdoc, Node *node);
static char *s_xhtml_1_0_end_marquee_tag (void *pdoc, Node *node);
+static char *s_xhtml_1_0_newline_mark (void *pdoc, Node *node);
static void s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
static int s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt);
s_xhtml_1_0_start_marquee_tag,
s_xhtml_1_0_end_marquee_tag,
},
+ /* tagNLMARK */
+ {
+ s_xhtml_1_0_newline_mark,
+ NULL,
+ },
};
/**
* @return The character string after the converting is returned.
*/
char *
-chxj_exchange_xhtml_mobile_1_0(
+chxj_convert_xhtml_mobile_1_0(
request_rec *r,
device_table *spec,
const char *src,
apr_size_t srclen,
apr_size_t *dstlen,
chxjconvrule_entry *entryp,
- cookie_t *UNUSED(cookie)
+ cookie_t *cookie
)
{
char *dst = NULL;
xhtml_t xhtml;
Doc doc;
- DBG(r,"start chxj_exchange_xhtml_mobile_1_0()");
+ DBG(r,"start chxj_convert_xhtml_mobile_1_0()");
/*--------------------------------------------------------------------------*/
/* If qrcode xml */
/*--------------------------------------------------------------------------*/
*dstlen = srclen;
dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
if (dst != NULL) {
- DBG(r,"end chxj_exchange_xhtml_mobile_1_0() (found qrcode.xml)");
+ DBG(r,"end chxj_convert_xhtml_mobile_1_0() (found qrcode.xml)");
return dst;
}
s_init_xhtml(&xhtml, &doc, r, spec);
xhtml.entryp = entryp;
+ xhtml.cookie = cookie;
- chxj_set_content_type(r, "text/html; charset=Windows-31J");
+ chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
/* The character string of the input is analyzed. */
/*--------------------------------------------------------------------------*/
/* It converts it from CHTML to XHTML. */
/*--------------------------------------------------------------------------*/
- chxj_node_exchange(spec,r,(void*)&xhtml, &doc, qs_get_root(&doc), 0);
+ chxj_node_convert(spec,r,(void *)&xhtml, &doc, qs_get_root(&doc), 0);
xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
dst = apr_pstrdup(r->pool, xhtml.out);
chxj_buffered_write_terminate(&doc.buf);
chxj_dump_out("[dst] CHTML->XHTML", dst, *dstlen);
#endif
- DBG(r,"end chxj_exchange_xhtml_mobile_1_0()");
+ DBG(r,"end chxj_convert_xhtml_mobile_1_0()");
return dst;
}
doc->r = r;
xhtml->doc = doc;
xhtml->spec = spec;
- xhtml->out = qs_alloc_zero_byte_string(r);
+ xhtml->out = qs_alloc_zero_byte_string(r->pool);
xhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
xhtml->doc->parse_mode = PARSE_MODE_CHTML;
}
}
+char *
+chxj_xhtml_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
+{
+ apr_size_t ii;
+ Doc __doc;
+ Doc *doc;
+ xhtml_t __xhtml;
+ xhtml_t *xhtml;
+ char one_byte[2];
+ char two_byte[3];
+ apr_pool_t *pool;
+
+ xhtml = &__xhtml;
+ doc = &__doc;
+
+ DBG(r, "REQ[%X] start chxj_xhtml_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
+ memset(doc, 0, sizeof(Doc));
+ memset(xhtml, 0, sizeof(xhtml_t));
+
+ doc->r = r;
+ xhtml->doc = doc;
+ xhtml->spec = spec;
+ xhtml->out = qs_alloc_zero_byte_string(r->pool);
+ xhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
+ xhtml->doc->parse_mode = PARSE_MODE_CHTML;
+
+ apr_pool_create(&pool, r->pool);
+
+ chxj_buffered_write_init(pool, &doc->buf);
+
+ for (ii=0; ii<len; ii++) {
+ char *out;
+ int rtn;
+
+ rtn = s_xhtml_search_emoji(xhtml, (char *)&src[ii], &out);
+ if (rtn) {
+ W_V(out);
+ ii+=(rtn - 1);
+ continue;
+ }
+
+ if (is_sjis_kanji(src[ii])) {
+ two_byte[0] = src[ii+0];
+ two_byte[1] = src[ii+1];
+ two_byte[2] = 0;
+ W_V(two_byte);
+ ii++;
+ }
+ else {
+ one_byte[0] = src[ii+0];
+ one_byte[1] = 0;
+ W_V(one_byte);
+ }
+ }
+ xhtml->out = chxj_buffered_write_flush(xhtml->out, &doc->buf);
+
+ DBG(r, "REQ[%X] end chxj_xhtml_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
+ return xhtml->out;
+}
+
+
/**
* It is a handler who processes the HTML tag.
*
/*--------------------------------------------------------------------------*/
/* Add XML Declare */
/*--------------------------------------------------------------------------*/
- W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>\r\n");
+ W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>");
+ W_NLCODE();
/*--------------------------------------------------------------------------*/
/* Add DocType */
/*--------------------------------------------------------------------------*/
- W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"\r\n");
- W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">\r\n");
+ W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"");
+ W_NLCODE();
+ W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">");
+ W_NLCODE();
/*--------------------------------------------------------------------------*/
/* start HTML tag */
/*--------------------------------------------------------------------------*/
W_L(" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"");
}
}
- W_L(">\r\n");
+ W_L(">");
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</html>\r\n");
+ W_L("</html>");
return xhtml->out;
}
Attr *attr;
Doc *doc = xhtml->doc;
int content_type_flag = 0;
+ request_rec *r = doc->r;
W_L("<meta");
/*--------------------------------------------------------------------------*/
attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
- if (STRCASEEQ('n','N',"name", name)) {
+ if (STRCASEEQ('n','N',"name", name) && value && *value) {
W_L(" ");
W_V(name);
W_L("=\"");
W_V(value);
W_L("\"");
}
- else if (STRCASEEQ('h','H',"http-equiv", name)) {
+ else if (STRCASEEQ('h','H',"http-equiv", name) && value && *value) {
W_L(" ");
W_V(name);
W_L("=\"");
content_type_flag = 1;
}
}
- else if (STRCASEEQ('c','C',"content", name)) {
+ else if (STRCASEEQ('c','C',"content", name) && value && *value) {
if (content_type_flag) {
W_L(" ");
W_V(name);
W_L("=\"");
- W_L("text/html; charset=Windows-31J");
+ W_V(chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
W_L("\"");
}
else {
}
}
}
- W_L(" />\r\n");
+ W_L(" />");
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("<head>\r\n");
+ W_L("<head>");
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</head>\r\n");
+ W_L("</head>");
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</title>\r\n");
+ W_L("</title>");
+
return xhtml->out;
}
break;
}
}
- W_L(" />\r\n");
+ W_L(" />");
+
return xhtml->out;
}
/* ignore */
}
}
- W_L(">\r\n");
+ W_L(">");
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</body>\r\n");
+ W_L("</body>");
return xhtml->out;
}
}
else if (STRCASEEQ('h','H',"href", name) && value && *value) {
value = chxj_encoding_parameter(r, value);
+ if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
+ value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
+ }
W_L(" href=\"");
W_V(value);
W_L("\"");
Doc *doc = xhtml->doc;
W_L("</a>");
+
return xhtml->out;
}
}
}
}
- W_L(" />\r\n");
+ W_L(" />");
+
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("<br />\r\n");
+ W_L("<br />");
+
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
Attr *attr;
+ char *size = NULL;
+ char *color = NULL;
- W_L("<font");
/*=========================================================================*/
/* Get Attributes */
/*=========================================================================*/
attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
- if (STRCASEEQ('c','C',"color",name)) {
- W_L(" color=\"");
- W_V(value);
- W_L("\"");
+ if (STRCASEEQ('c','C',"color",name) && value && *value) {
+ color = apr_pstrdup(doc->buf.pool, value);
}
- else if (STRCASEEQ('s','S',"size",name)) {
- W_L(" size=\"");
- W_V(value);
- W_L("\"");
+ else if (STRCASEEQ('s','S',"size",name) && value && *value) {
+ size = apr_pstrdup(doc->buf.pool, value);
+ }
+ }
+ if (color) {
+ W_L("<font color=\"");
+ W_V(color);
+ W_L("\">");
+ xhtml->font_color_flag++;
+ }
+ if (size) {
+ xhtml->font_size_flag++;
+ switch(*size) {
+ case '1': W_L("<span style=\"font-size: xx-small\">"); break;
+ case '2': W_L("<span style=\"font-size: x-small\">"); break;
+ case '3': W_L("<span style=\"font-size: small\">"); break;
+ case '4': W_L("<span style=\"font-size: medium\">"); break;
+ case '5': W_L("<span style=\"font-size: large\">"); break;
+ case '6': W_L("<span style=\"font-size: x-large\">"); break;
+ case '7': W_L("<span style=\"font-size: xx-large\">"); break;
+ case '-':
+ if (*(size + 1) == '1') {
+ W_L("<span style=\"font-size: small\">");
+ break;
+ }
+ if (*(size + 1) == '2') {
+ W_L("<span style=\"font-size: x-small\">");
+ break;
+ }
+ if (*(size + 1) == '3') {
+ W_L("<span style=\"font-size: xx-small\">");
+ break;
+ }
+ xhtml->font_size_flag--;
+ break;
+
+ case '+':
+ if (*(size + 1) == '1') {
+ W_L("<span style=\"font-size: large\">");
+ break;
+ }
+ if (*(size + 1) == '2') {
+ W_L("<span style=\"font-size: x-large\">");
+ break;
+ }
+ if (*(size + 1) == '3') {
+ W_L("<span style=\"font-size: xx-large\">");
+ break;
+ }
+ xhtml->font_size_flag--;
+ break;
+
+ default:
+ WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
+ xhtml->font_size_flag--;
}
}
- W_L(">");
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</font>");
+ if (xhtml->font_size_flag) {
+ W_L("</span>");
+ xhtml->font_size_flag--;
+ }
+ if (xhtml->font_color_flag) {
+ W_L("</font>");
+ xhtml->font_color_flag--;
+ }
return xhtml->out;
}
Doc *doc = xhtml->doc;
request_rec *r = doc->r;
Attr *attr;
+ char *new_hidden_tag = NULL;
+ char *attr_action = NULL;
+ char *attr_method = NULL;
+ char *attr_name = NULL;
- W_L("<form");
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
if (STRCASEEQ('a','A',"action",name)) {
- value = chxj_encoding_parameter(r, value);
- W_L(" action=\"");
- W_V(value);
- W_L("\"");
+ attr_action = chxj_encoding_parameter(r, value);
+ attr_action = chxj_add_cookie_parameter(r, attr_action, xhtml->cookie);
}
else if (STRCASEEQ('m','M',"method",name)) {
- W_L(" method=\"");
- W_V(value);
- W_L("\"");
+ attr_method = apr_pstrdup(doc->pool, value);
}
else if (STRCASEEQ('u','U',"utn",name)) {
/* ignore */
}
+ else if (STRCASEEQ('n','N',"name",name)) {
+ attr_name = apr_pstrdup(doc->pool, value);
+ }
+ }
+
+ int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
+
+ W_L("<form");
+ if (attr_action) {
+ char *q;
+ char *old_qs = NULL;
+ q = strchr(attr_action, '?');
+ if (q) {
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag, &old_qs, CHXJ_FALSE, CHXJ_FALSE, xhtml->entryp);
+ if (new_hidden_tag || old_qs) {
+ *q = 0;
+ }
+ }
+ W_L(" action=\"");
+ W_V(attr_action);
+ if (old_qs) {
+ W_L("?");
+ W_V(old_qs);
+ }
+ W_L("\"");
+ }
+ if (attr_method) {
+ W_L(" method=\"");
+ W_V(attr_method);
+ W_L("\"");
+ }
+ if (attr_name) {
+ W_L(" name=\"");
+ W_V(attr_name);
+ W_L("\"");
}
W_L(">");
+ if (new_hidden_tag) {
+ W_V(new_hidden_tag);
+ }
return xhtml->out;
}
Doc *doc = xhtml->doc;
W_L("</form>");
+
return xhtml->out;
}
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
- type = qs_get_type_attr(doc, node, r);
- name = qs_get_name_attr(doc, node, r);
- value = qs_get_value_attr(doc,node,r);
- istyle = qs_get_istyle_attr(doc,node,r);
- max_length = qs_get_maxlength_attr(doc,node,r);
- checked = qs_get_checked_attr(doc,node,r);
- accesskey = qs_get_accesskey_attr(doc, node, r);
- size = qs_get_size_attr(doc, node, r);
+ type = qs_get_type_attr(doc, node, doc->buf.pool);
+ name = qs_get_name_attr(doc, node, doc->buf.pool);
+ value = qs_get_value_attr(doc,node, doc->buf.pool);
+ istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
+ max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
+ checked = qs_get_checked_attr(doc,node, doc->buf.pool);
+ accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
+ size = qs_get_size_attr(doc, node, doc->buf.pool);
if (type) {
type = qs_trim_string(doc->buf.pool, type);
}
if (value && *value) {
W_L(" value=\"");
- W_V(value);
+ W_V(chxj_add_slash_to_doublequote(doc->pool, value));
W_L("\"");
}
if (accesskey && *accesskey) {
W_L(" checked=\"checked\"");
}
W_L(" />");
+
return xhtml->out;
}
/*----------------------------------------------------------------------*/
/* ignore */
}
- else if (STRCASEEQ('c','C',"color", name)) {
+ else if (STRCASEEQ('c','C',"color", name) && value && *value) {
/*----------------------------------------------------------------------*/
/* CHTML 4.0 */
/*----------------------------------------------------------------------*/
- /* ignore */
+ W_L(" color=\"");
+ W_V(value);
+ W_L("\"");
}
}
W_L(" />");
* @return The conversion result is returned.
*/
static char *
-s_xhtml_1_0_start_ul_tag(void *pdoc, Node *UNUSED(node))
+s_xhtml_1_0_start_ul_tag(void *pdoc, Node *node)
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
-
- W_L("<ul>");
+ Attr *attr;
+ W_L("<ul");
+ /*--------------------------------------------------------------------------*/
+ /* Get Attributes */
+ /*--------------------------------------------------------------------------*/
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char *name = qs_get_attr_name(doc,attr);
+ char *value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('t','T',"type",name)) {
+ if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
+ W_L(" type=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ }
+ }
+ W_L(">");
return xhtml->out;
}
for (attr = qs_get_attr(doc,node);
attr;
attr = qs_get_next_attr(doc,attr)) {
- char *name = qs_get_attr_name(doc,attr);
+ char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
- if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
- W_L(" type=\"");
- W_V(value);
- W_L("\"");
+ if (STRCASEEQ('t','T',"type",name)) {
+ if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
+ W_L(" type=\"");
+ W_V(value);
+ W_L("\"");
+ }
}
else if (STRCASEEQ('v','V',"value", name) && value && *value) {
W_L(" value=\"");
if (STRCASEEQ('s','S',"src",name)) {
value = chxj_encoding_parameter(r, value);
+ value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
+ value = chxj_add_cookie_no_update_parameter(r, value);
#ifdef IMG_NOT_CONVERT_FILENAME
W_L(" src=\"");
}
else
if (STRCASEEQ('a','A',"align",name)) {
- if (value && (STRCASEEQ('t','T',"top", value) ||
- STRCASEEQ('m','M',"middle",value) ||
- STRCASEEQ('b','B',"bottom",value) ||
- STRCASEEQ('l','L',"left", value) ||
- STRCASEEQ('r','R',"right", value))) {
- W_L(" align=\"");
- W_V(value);
- W_L("\"");
+ if (value) {
+ if (STRCASEEQ('t','T',"top", value) ||
+ STRCASEEQ('m','M',"middle",value) ||
+ STRCASEEQ('b','B',"bottom",value) ||
+ STRCASEEQ('l','L',"left", value) ||
+ STRCASEEQ('r','R',"right", value)) {
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ else if (STRCASEEQ('c','C',"center", value)) {
+ W_L(" align=\"");
+ W_L("middle");
+ W_L("\"");
+ }
}
}
else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
/* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
W_L(" multiple=\"true\"");
}
- W_L(">\r\n");
+ W_L(">");
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</select>\r\n");
+ W_L("</select>");
return xhtml->out;
}
value = apr_pstrdup(doc->buf.pool, val);
}
}
- if (value && *value) {
+ if (value) {
W_L(" value=\"");
W_V(value);
W_L("\"");
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</option>\r\n");
+ W_L("</option>");
return xhtml->out;
}
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</div>\r\n");
+ W_L("</div>");
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</div>\n");
+ W_L("</div>");
return xhtml->out;
}
W_L("\"");
}
}
- W_L(">\r\n");
+ W_L(">");
return xhtml->out;
}
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("</textarea>\r\n");
+ W_L("</textarea>");
xhtml->textarea_flag--;
return xhtml->out;
tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
memset(tmp, 0, qs_get_node_size(doc,child)+1);
- tdst = qs_alloc_zero_byte_string(r);
+ tdst = qs_alloc_zero_byte_string(doc->buf.pool);
memset(one_byte, 0, sizeof(one_byte));
tdst_len = 0;
* @return The conversion result is returned.
*/
static char *
-s_xhtml_1_0_start_dir_tag(void *pdoc, Node *UNUSED(child))
+s_xhtml_1_0_start_dir_tag(void *pdoc, Node *node)
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
- W_L("<dir>");
+ Attr *attr;
+ W_L("<dir");
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char *name = qs_get_attr_name(doc,attr);
+ char *value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('t','T',"type",name)) {
+ if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
+ W_L(" type=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ }
+ }
+ W_L(">");
return xhtml->out;
}
* @return The conversion result is returned.
*/
static char *
-s_xhtml_1_0_start_menu_tag(void *pdoc, Node *UNUSED(child))
+s_xhtml_1_0_start_menu_tag(void *pdoc, Node *node)
{
- xhtml_t *xhtml;
- Doc *doc;
- xhtml = GET_XHTML(pdoc);
- doc = xhtml->doc;
- W_L("<menu>");
+ xhtml_t *xhtml = GET_XHTML(pdoc);
+ Doc *doc = xhtml->doc;
+ Attr *attr;
+ W_L("<menu");
+ /*--------------------------------------------------------------------------*/
+ /* Get Attributes */
+ /*--------------------------------------------------------------------------*/
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char *name = qs_get_attr_name(doc,attr);
+ char *value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('t','T',"type",name)) {
+ if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
+ W_L(" type=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ }
+ }
+ W_L(">");
return xhtml->out;
}
W_L("\"");
}
}
+ else if (STRCASEEQ('b','B',"bgcolor",name)) {
+ if (value && *value) {
+ W_L(" bgcolor=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ }
}
W_L(">");
return xhtml->out;
W_L("</marquee>");
return xhtml->out;
}
+
+
+/**
+ * It is handler who processes the New Line Code.
+ */
+static char *
+s_xhtml_1_0_newline_mark(void *pdoc, Node *UNUSED(node))
+{
+ xhtml_t *xhtml = GET_XHTML(pdoc);
+ Doc *doc = xhtml->doc;
+ W_NLCODE();
+ return xhtml->out;
+}
/*
* vim:ts=2 et
*/