#undef W_V
#define W_L(X) do { chtml30->out = BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, (X)); } while(0)
#define W_V(X) do { chtml30->out = (X) ? BUFFERED_WRITE_VALUE(chtml30->out, &doc->buf, (X)) \
- : BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, ""); } while(0)
+ : BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, ""); } while(0)
+extern tag_handler chtml20_handler[];
static char *s_chtml30_start_html_tag (void *pdoc, Node *node);
static char *s_chtml30_end_html_tag (void *pdoc, Node *node);
static char *s_chtml30_end_marquee_tag (void *pdoc, Node *node);
static char *s_chtml30_start_blink_tag (void *pdoc, Node *node);
static char *s_chtml30_end_blink_tag (void *pdoc, Node *node);
+static char *s_chtml30_start_menu_tag (void *pdoc, Node *node);
+static char *s_chtml30_end_menu_tag (void *pdoc, Node *node);
+static char *s_chtml30_start_plaintext_tag (void *pdoc, Node *node);
+static char *s_chtml30_start_plaintext_tag_inner (void *pdoc, Node *node);
+static char *s_chtml30_end_plaintext_tag (void *pdoc, Node *node);
static void s_init_chtml30(chtml30_t *chtml, Doc *doc, request_rec *r, device_table *spec);
},
/* tagMENU */
{
- NULL,
- NULL,
+ s_chtml30_start_menu_tag,
+ s_chtml30_end_menu_tag,
},
/* tagPLAINTEXT */
{
- NULL,
- NULL,
+ s_chtml30_start_plaintext_tag,
+ s_chtml30_end_plaintext_tag,
},
/* tagBLINK */
{
switch(*name) {
case 'h':
case 'H':
- if (strcasecmp(name, "http-equiv") == 0) {
+ if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
/*----------------------------------------------------------------------*/
/* CHTML 2.0 */
/*----------------------------------------------------------------------*/
case 'c':
case 'C':
- if (strcasecmp(name, "content") == 0) {
+ if (strcasecmp(name, "content") == 0 && value && *value) {
if (content_type_flag) {
W_L(" ");
W_V(name);
doc = chtml30->doc;
r = doc->r;
- W_L("</title>\r\n");
+ W_L("</title>");
return chtml30->out;
}
doc = chtml30->doc;
r = doc->r;
- W_L("<br>\r\n");
+ W_L("<br>");
return chtml30->out;
}
* @param node [i] The FORM tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_form_tag(void* pdoc, Node* node)
+static char *
+s_chtml30_start_form_tag(void *pdoc, Node *node)
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
- Attr* attr;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
W_L("<form");
-
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
for (attr = qs_get_attr(doc,node);
attr;
attr = qs_get_next_attr(doc,attr)) {
-
- char* name;
- char* value;
-
- name = qs_get_attr_name(doc,attr);
- value = qs_get_attr_value(doc,attr);
-
+ char *name = qs_get_attr_name(doc,attr);
+ char *value = qs_get_attr_value(doc,attr);
if (STRCASEEQ('a','A',"action", name)) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/* CHTML 3.0 */
/* It is special only for CHTML. */
/*----------------------------------------------------------------------*/
- W_L(" utn ");
+ W_L(" utn");
}
}
-
W_L(">");
-
return chtml30->out;
}
* @param node [i] The INPUT tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_input_tag(void* pdoc, Node* node)
+static char *
+s_chtml30_start_input_tag(void *pdoc, Node *node)
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
- char* max_length = NULL;
- char* type = NULL;
- char* name = NULL;
- char* value = NULL;
- char* istyle = NULL;
- char* size = NULL;
- char* checked = NULL;
- char* accesskey = NULL;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ char *max_length = NULL;
+ char *type = NULL;
+ char *name = NULL;
+ char *value = NULL;
+ char *istyle = NULL;
+ char *size = NULL;
+ char *checked = NULL;
+ char *accesskey = NULL;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
-
-
W_L("<input");
-
/*--------------------------------------------------------------------------*/
/* 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);
size = qs_get_size_attr(doc, node, r);
if (type) {
- W_L(" type=\"");
- W_V(type);
- W_L("\"");
+ type = qs_trim_string(doc->buf.pool, type);
+ if (type && (STRCASEEQ('t','T',"text", type) ||
+ STRCASEEQ('p','P',"password",type) ||
+ STRCASEEQ('c','C',"checkbox",type) ||
+ STRCASEEQ('r','R',"radio", type) ||
+ STRCASEEQ('h','H',"hidden", type) ||
+ STRCASEEQ('s','S',"submit", type) ||
+ STRCASEEQ('r','R',"reset", type))) {
+ W_L(" type=\"");
+ W_V(type);
+ W_L("\"");
+ }
}
-
- if (size) {
+ if (size && *size) {
W_L(" size=\"");
W_V(size);
- W_L("\" ");
+ W_L("\"");
}
-
- if (name) {
+ if (name && *name) {
W_L(" name=\"");
W_V(name);
- W_L("\" ");
+ W_L("\"");
}
-
- if (value) {
+ if (value && *value) {
W_L(" value=\"");
W_V(value);
- W_L("\" ");
+ W_L("\"");
}
-
- if (accesskey) {
+ if (accesskey && *accesskey) {
W_L(" accesskey=\"");
W_V(accesskey);
- W_L("\" ");
+ W_L("\"");
}
-
- if (istyle != NULL) {
+ if (istyle) {
/*------------------------------------------------------------------------*/
/* CHTML 2.0 */
/*------------------------------------------------------------------------*/
- W_L(" istyle=\"");
- W_V(istyle);
- W_L("\" ");
+ if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
+ W_L(" istyle=\"");
+ W_V(istyle);
+ W_L("\"");
+ }
}
/*--------------------------------------------------------------------------*/
/* The figure is default for the password. */
/*--------------------------------------------------------------------------*/
- if (max_length) {
- if (chxj_chk_numeric(max_length) != 0)
+ if (max_length && *max_length) {
+ if (chxj_chk_numeric(max_length) != 0) {
max_length = apr_psprintf(r->pool, "0");
-
- if (istyle != NULL && strcasecmp(istyle, "1") == 0) {
+ }
+ if (istyle != NULL && *istyle == '1') {
char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
W_V(vv);
}
W_V(vv);
}
}
-
if (checked) {
- W_L(" checked ");
+ W_L(" checked");
}
-
- W_L(" >");
-
+ W_L(">");
return chtml30->out;
}
doc = chtml30->doc;
r = doc->r;
- W_L("<hr ");
+ W_L("<hr");
for (attr = qs_get_attr(doc,node);
attr;
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
- W_L(" align=\"");
- W_V(value);
- W_L("\" ");
+ if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+ }
}
else if (STRCASEEQ('s','S',"size", name)) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
- W_L(" size=\"");
- W_V(value);
- W_L("\" ");
+ if (value && *value) {
+ W_L(" size=\"");
+ W_V(value);
+ W_L("\"");
+ }
}
else if (STRCASEEQ('w','W',"width", name)) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
- W_L(" width=\"");
- W_V(value);
- W_L("\" ");
+ if (value && *value) {
+ W_L(" width=\"");
+ W_V(value);
+ W_L("\"");
+ }
}
else if (STRCASEEQ('n','N',"noshade", name)) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
- W_L(" noshade ");
+ W_L(" noshade");
}
else if (STRCASEEQ('c','C',"color", name)) {
/*----------------------------------------------------------------------*/
}
}
- W_L(" >");
+ W_L(">");
return chtml30->out;
}
* @param node [i] The IMG tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_img_tag(void* pdoc, Node* node)
+static char *
+s_chtml30_start_img_tag(void *pdoc, Node *node)
{
#ifndef IMG_NOT_CONVERT_FILENAME
device_table *spec;
#endif
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
- Attr* attr;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
#endif
W_L("<img");
-
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
- W_L(" align=\"");
- W_V(value);
- W_L("\"");
+ 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("\"");
+ }
}
- else if (STRCASEEQ('w','W',"width", name)) {
+ else if (STRCASEEQ('w','W',"width", name) && value && *value) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
W_V(value);
W_L("\"");
}
- else if (STRCASEEQ('h','H', "height", name)) {
+ else if (STRCASEEQ('h','H', "height", name) && value && *value) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
W_V(value);
W_L("\"");
}
- else if (STRCASEEQ('h','H',"hspace", name)) {
+ else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
W_V(value);
W_L("\"");
}
- else if (STRCASEEQ('v','V',"vspace", name)) {
+ else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
W_V(value);
W_L("\"");
}
- else if (STRCASEEQ('a','A',"alt",name)) {
+ else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 */
/*----------------------------------------------------------------------*/
W_V(value);
W_L("\"");
}
- else if (STRCASEEQ('a','A',"align", name)) {
+ else if (STRCASEEQ('a','A',"align", name) && value && *value) {
/*----------------------------------------------------------------------*/
/* CHTML 4.0 */
/*----------------------------------------------------------------------*/
static char*
s_chtml30_start_select_tag(void* pdoc, Node* child)
{
-
- char* size;
- char* name;
- Attr* attr;
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
-
- chtml30 = GET_CHTML30(pdoc);
- doc = chtml30->doc;
- r = doc->r;
- size = NULL;
- name = NULL;
+ chtml30_t *chtml30 = GET_CHTML30(pdoc);
+ Doc *doc = chtml30->doc;
+ char *size = NULL;
+ char *name = NULL;
+ char *multiple = NULL;
+ Attr *attr;
W_L("<select");
attr = qs_get_next_attr(doc,attr)) {
char* nm = qs_get_attr_name(doc,attr);
char* val = qs_get_attr_value(doc,attr);
-
if (STRCASEEQ('s','S',"size", nm)) {
/*----------------------------------------------------------------------*/
/* CHTML 1.0 version 2.0 */
/*----------------------------------------------------------------------*/
/* CHTML 1.0 version 2.0 */
/*----------------------------------------------------------------------*/
- /* not support */
+ multiple = apr_pstrdup(doc->buf.pool, val);
}
}
-
- if (size) {
+ if (size && *size) {
W_L(" size=\"");
W_V(size);
W_L("\"");
}
-
- if (name) {
+ if (name && *name) {
W_L(" name=\"");
W_V(name);
W_L("\"");
}
-
- W_L(">\n");
-
+ if (multiple) {
+ W_L(" multiple");
+ }
+ W_L(">");
return chtml30->out;
}
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
-
- W_L("</select>\n");
-
+ W_L("</select>");
return chtml30->out;
}
* @param node [i] The OPTION tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_option_tag(void* pdoc, Node* child)
+static char *
+s_chtml30_start_option_tag(void *pdoc, Node *child)
{
- Attr* attr;
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
- char* selected;
- char* value;
+ Attr *attr;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ char *selected;
+ char *value;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
value = NULL;
W_L("<option");
-
for (attr = qs_get_attr(doc,child);
attr;
attr = qs_get_next_attr(doc,attr)) {
value = apr_pstrdup(doc->buf.pool, val);
}
}
-
- if (value) {
+ if (value && *value) {
W_L(" value=\"");
W_V(value);
W_L("\"");
}
- else {
- W_L(" value=\"\"");
- }
-
if (selected) {
W_L(" selected");
}
-
W_L(">");
return chtml30->out;
/*----------------------------------------------------------------------*/
/* CHTML 1.0 (W3C version 3.2) */
/*----------------------------------------------------------------------*/
- align = apr_pstrdup(doc->buf.pool, val);
+ if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
+ align = apr_pstrdup(doc->buf.pool, val);
+ }
}
}
doc = chtml30->doc;
r = doc->r;
- W_L("</div>\n");
+ W_L("</div>");
return chtml30->out;
}
* @return The conversion result is returned.
*/
static char *
-s_chtml30_start_p_tag(void *pdoc, Node *UNUSED(node))
+s_chtml30_start_p_tag(void *pdoc, Node *node)
{
chtml30_t *chtml30;
Doc *doc;
request_rec *r;
+ Attr *attr;
+ char *align = NULL;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("<p>");
+ W_L("<p");
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char *nm = qs_get_attr_name(doc,attr);
+ char *val = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('a','A',"align", nm)) {
+ /*----------------------------------------------------------------------*/
+ /* CHTML 1.0 (W3C version 3.2) */
+ /*----------------------------------------------------------------------*/
+ if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
+ align = apr_pstrdup(doc->buf.pool, val);
+ break;
+ }
+ }
+ }
+ if (align) {
+ W_L(" align=\"");
+ W_V(align);
+ W_L("\"");
+ }
+ W_L(">");
return chtml30->out;
}
* @return The conversion result is returned.
*/
static char *
-s_chtml30_start_ol_tag(void *pdoc, Node *UNUSED(node))
+s_chtml30_start_ol_tag(void *pdoc, Node *node)
{
chtml30_t *chtml30;
Doc *doc;
request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("<ol>");
+ W_L("<ol");
+ /*--------------------------------------------------------------------------*/
+ /* 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) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
+ W_L(" type=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ else if (STRCASEEQ('s','S',"start",name) && value && *value) {
+ W_L(" start=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ }
+ W_L(">");
return chtml30->out;
}
* @param node [i] The LI tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_li_tag(void* pdoc, Node* UNUSED(node))
+static char *
+s_chtml30_start_li_tag(void *pdoc, Node *node)
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("<li>");
+ W_L("<li");
+ /*--------------------------------------------------------------------------*/
+ /* 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) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
+ W_L(" type=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ else if (STRCASEEQ('v','V',"value", name) && value && *value) {
+ W_L(" value=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ }
+ W_L(">");
return chtml30->out;
}
* @return The conversion result is returned.
*/
static char *
-s_chtml30_start_h1_tag(void *pdoc, Node *UNUSED(node))
+s_chtml30_start_h1_tag(void *pdoc, Node *node)
{
chtml30_t *chtml30;
Doc *doc;
request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("<h1>\r\n");
+ W_L("<h1");
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char* name;
+ char* value;
+ name = qs_get_attr_name(doc,attr);
+ value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('a','A',"align", name)) {
+ if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+ break;
+ }
+ }
+ }
+ W_L(">");
return chtml30->out;
}
doc = chtml30->doc;
r = doc->r;
- W_L("</h1>\r\n");
+ W_L("</h1>");
return chtml30->out;
}
* @param node [i] The H2 tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_h2_tag(void* pdoc, Node* UNUSED(node))
+static char *
+s_chtml30_start_h2_tag(void *pdoc, Node *node)
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("<h2>\r\n");
-
+ W_L("<h2");
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char* name;
+ char* value;
+ name = qs_get_attr_name(doc,attr);
+ value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('a','A',"align", name)) {
+ if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+ break;
+ }
+ }
+ }
+ W_L(">");
return chtml30->out;
}
* @param node [i] The H2 tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_end_h2_tag(void* pdoc, Node* UNUSED(child))
+static char *
+s_chtml30_end_h2_tag(void *pdoc, Node *UNUSED(child))
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("</h2>\r\n");
+ W_L("</h2>");
return chtml30->out;
}
* @param node [i] The H3 tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_h3_tag(void* pdoc, Node* UNUSED(node))
+static char *
+s_chtml30_start_h3_tag(void *pdoc, Node *node)
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("<h3>\r\n");
+ W_L("<h3");
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char* name;
+ char* value;
+ name = qs_get_attr_name(doc,attr);
+ value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('a','A',"align", name)) {
+ if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+ break;
+ }
+ }
+ }
+ W_L(">");
return chtml30->out;
}
* @param node [i] The H3 tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_end_h3_tag(void* pdoc, Node* UNUSED(child))
+static char *
+s_chtml30_end_h3_tag(void *pdoc, Node *UNUSED(child))
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("</h3>\r\n");
+ W_L("</h3>");
return chtml30->out;
}
* @param node [i] The H4 tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_h4_tag(void* pdoc, Node* UNUSED(node))
+static char *
+s_chtml30_start_h4_tag(void *pdoc, Node *node)
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("<h4>\r\n");
-
+ W_L("<h4");
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char* name;
+ char* value;
+ name = qs_get_attr_name(doc,attr);
+ value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('a','A',"align", name)) {
+ if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+ break;
+ }
+ }
+ }
+ W_L(">");
return chtml30->out;
}
* @param node [i] The H4 tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_end_h4_tag(void* pdoc, Node* UNUSED(child))
+static char *
+s_chtml30_end_h4_tag(void *pdoc, Node *UNUSED(child))
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("</h4>\r\n");
+ W_L("</h4>");
return chtml30->out;
}
* @param node [i] The H5 tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_h5_tag(void* pdoc, Node* UNUSED(node))
+static char *
+s_chtml30_start_h5_tag(void *pdoc, Node *node)
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("<h5>\r\n");
-
+ W_L("<h5");
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char *name;
+ char *value;
+ name = qs_get_attr_name(doc,attr);
+ value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('a','A',"align", name)) {
+ if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+ break;
+ }
+ }
+ }
+ W_L(">");
return chtml30->out;
}
doc = chtml30->doc;
r = doc->r;
- W_L("</h5>\r\n");
+ W_L("</h5>");
return chtml30->out;
}
* @param node [i] The H6 tag node is specified.
* @return The conversion result is returned.
*/
-static char*
-s_chtml30_start_h6_tag(void* pdoc, Node* UNUSED(node))
+static char *
+s_chtml30_start_h6_tag(void *pdoc, Node *node)
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
chtml30 = GET_CHTML30(pdoc);
doc = chtml30->doc;
r = doc->r;
- W_L("<h6>\r\n");
-
+ W_L("<h6");
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char *name;
+ char *value;
+ name = qs_get_attr_name(doc,attr);
+ value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('a','A',"align", name)) {
+ if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+ W_L(" align=\"");
+ W_V(value);
+ W_L("\"");
+ break;
+ }
+ }
+ }
+ W_L(">");
return chtml30->out;
}
doc = chtml30->doc;
r = doc->r;
- W_L("</h6>\r\n");
+ W_L("</h6>");
return chtml30->out;
}
chtml30->textarea_flag++;
- W_L("<textarea ");
+ W_L("<textarea");
for (attr = qs_get_attr(doc,node);
attr;
attr = qs_get_next_attr(doc,attr)) {
W_V(value);
W_L("\"");
}
- else if (STRCASEEQ('n','N',"name", name)) {
+ else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
+ W_L(" istyle=\"");
+ W_V(value);
+ W_L("\"");
+ }
+ else if (STRCASEEQ('n','N',"name", name) && value && *value) {
W_L(" name=\"");
W_V(value);
W_L("\"");
}
- else if (STRCASEEQ('r','R',"rows", name)) {
+ else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
W_L(" rows=\"");
W_V(value);
W_L("\"");
}
- else if (STRCASEEQ('c','C',"cols", name)) {
+ else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
W_L(" cols=\"");
W_V(value);
W_L("\"");
}
}
- W_L(">\r\n");
+ W_L(">");
return chtml30->out;
}
doc = chtml30->doc;
r = doc->r;
- W_L("</textarea>\r\n");
+ W_L("</textarea>");
chtml30->textarea_flag--;
return chtml30->out;
return NULL;
}
-static char*
-s_chtml30_text_tag(void* pdoc, Node* child)
+static char *
+s_chtml30_text_tag(void *pdoc, Node *child)
{
- chtml30_t* chtml30;
- Doc* doc;
- request_rec* r;
+ chtml30_t *chtml30;
+ Doc *doc;
+ request_rec *r;
- char* textval;
- char* tmp;
- char* tdst;
+ char *textval;
+ char *tmp;
+ char *tdst;
char one_byte[2];
int ii;
int tdst_len;
r = doc->r;
textval = qs_get_node_value(doc,child);
- textval = qs_trim_string(doc->buf.pool, textval);
- if (strlen(textval) == 0)
+ if (strlen(textval) == 0) {
return chtml30->out;
+ }
tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
memset(tmp, 0, qs_get_node_size(doc,child)+1);
return chtml30->out;
}
+
/**
- * It is a handter who processes the DT tag.
+ * It is a handler who processes the DT tag.
*
* @param pdoc [i/o] The pointer to the CHTML structure at the output
* destination is specified.
/**
- * It is a handter who processes the DT tag.
+ * It is a handler who processes the DT tag.
*
* @param pdoc [i/o] The pointer to the CHTML structure at the output
* destination is specified.
/**
- * It is a handder who processes the DD tag.
+ * It is a handler who processes the DD tag.
*
* @param pdoc [i/o] The pointer to the CHTML structure at the output
* destination is specified.
/**
- * It is a handder who processes the DD tag.
+ * It is a handler who processes the DD tag.
*
* @param pdoc [i/o] The pointer to the CHTML structure at the output
* destination is specified.
/**
- * It is a hanmarqueeer who processes the MARQUEE tag.
+ * It is a handler who processes the MARQUEE tag.
*
* @param pdoc [i/o] The pointer to the CHTML structure at the output
* destination is specified.
/**
- * It is a hanmarqueeer who processes the MARQUEE tag.
+ * It is a handler who processes the MARQUEE tag.
*
* @param pdoc [i/o] The pointer to the CHTML structure at the output
* destination is specified.
W_L("</blink>");
return chtml30->out;
}
+
+
+/**
+ * It is a handler who processes the MENU tag.
+ *
+ * @param pdoc [i/o] The pointer to the CHTML structure at the output
+ * destination is specified.
+ * @param node [i] The MENU tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_chtml30_start_menu_tag(void *pdoc, Node *UNUSED(child))
+{
+ chtml30_t *chtml30;
+ Doc *doc;
+ chtml30 = GET_CHTML30(pdoc);
+ doc = chtml30->doc;
+ W_L("<menu>");
+ return chtml30->out;
+}
+
+
+/**
+ * It is a handler who processes the MENU tag.
+ *
+ * @param pdoc [i/o] The pointer to the CHTML structure at the output
+ * destination is specified.
+ * @param node [i] The MENU tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_chtml30_end_menu_tag(void *pdoc, Node *UNUSED(child))
+{
+ chtml30_t *chtml30 = GET_CHTML30(pdoc);
+ Doc *doc = chtml30->doc;
+ W_L("</menu>");
+ return chtml30->out;
+}
+
+
+/**
+ * It is a handler who processes the PLAINTEXT tag.
+ *
+ * @param pdoc [i/o] The pointer to the CHTML structure at the output
+ * destination is specified.
+ * @param node [i] The PLAINTEXT tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_chtml30_start_plaintext_tag(void *pdoc, Node *node)
+{
+ chtml30_t *chtml30;
+ Doc *doc;
+
+ chtml30 = GET_CHTML30(pdoc);
+ doc = chtml30->doc;
+ W_L("<plaintext>");
+ s_chtml30_start_plaintext_tag_inner(pdoc,node);
+ return chtml30->out;
+}
+
+static char *
+s_chtml30_start_plaintext_tag_inner(void *pdoc, Node *node)
+{
+ chtml30_t *chtml30;
+ Doc *doc;
+ Node *child;
+ chtml30 = GET_CHTML30(pdoc);
+ doc = chtml30->doc;
+ for (child = qs_get_child_node(doc, node);
+ child;
+ child = qs_get_next_node(doc, child)) {
+ W_V(child->otext);
+ s_chtml30_start_plaintext_tag_inner(pdoc, child);
+ }
+ return chtml30->out;
+}
+
+
+/**
+ * It is a handler who processes the PLAINTEXT tag.
+ *
+ * @param pdoc [i/o] The pointer to the CHTML structure at the output
+ * destination is specified.
+ * @param node [i] The PLAINTEXT tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_chtml30_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
+{
+ chtml30_t *chtml30 = GET_CHTML30(pdoc);
+ return chtml30->out;
+}
/*
* vim:ts=2 et
*/