2 * Copyright (C) 2005-2011 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #include "chxj_chtml10.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_cookie.h"
23 #include "chxj_encoding.h"
24 #include "chxj_buffered_write.h"
25 #include "chxj_str_util.h"
26 #include "chxj_header_inf.h"
27 #include "chxj_conv_z2h.h"
28 #include "chxj_google.h"
30 #define GET_CHTML10(X) ((chtml10_t *)(X))
33 #define W_L(X) do { chtml10->out = BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, (X)); } while(0)
34 #define W_V(X) do { chtml10->out = (X) ? BUFFERED_WRITE_VALUE(chtml10->out, &doc->buf, (X)) \
35 : BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, ""); } while(0)
38 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml10->conf); W_V(nlcode); } while (0)
40 #define CHTML10_PUSH_ONLY(tagname) \
45 char *attr_style = NULL; \
46 chtml10 = GET_CHTML10(pdoc); \
48 for (attr = qs_get_attr(doc,node); \
50 attr = qs_get_next_attr(doc,attr)) { \
51 char *nm = qs_get_attr_name(doc,attr); \
52 char *val = qs_get_attr_value(doc,attr); \
53 if (val && STRCASEEQ('s','S',"style", nm)) { \
58 if (IS_CSS_ON(chtml10->entryp)) { \
59 s_chtml10_push_and_get_now_style(pdoc, node, attr_style); \
61 return chtml10->out; \
65 static char *s_chtml10_start_html_tag (void *pdoc, Node *node);
66 static char *s_chtml10_end_html_tag (void *pdoc, Node *node);
67 static char *s_chtml10_start_meta_tag (void *pdoc, Node *node);
68 static char *s_chtml10_end_meta_tag (void *pdoc, Node *node);
69 static char *s_chtml10_start_textarea_tag (void *pdoc, Node *node);
70 static char *s_chtml10_end_textarea_tag (void *pdoc, Node *node);
71 static char *s_chtml10_start_p_tag (void *pdoc, Node *node);
72 static char *s_chtml10_end_p_tag (void *pdoc, Node *node);
73 static char *s_chtml10_start_pre_tag (void *pdoc, Node *node);
74 static char *s_chtml10_end_pre_tag (void *pdoc, Node *node);
75 static char *s_chtml10_start_ul_tag (void *pdoc, Node *node);
76 static char *s_chtml10_end_ul_tag (void *pdoc, Node *node);
77 static char *s_chtml10_start_li_tag (void *pdoc, Node *node);
78 static char *s_chtml10_end_li_tag (void *pdoc, Node *node);
79 static char *s_chtml10_start_ol_tag (void *pdoc, Node *node);
80 static char *s_chtml10_end_ol_tag (void *pdoc, Node *node);
81 static char *s_chtml10_start_h1_tag (void *pdoc, Node *node);
82 static char *s_chtml10_end_h1_tag (void *pdoc, Node *node);
83 static char *s_chtml10_start_h2_tag (void *pdoc, Node *node);
84 static char *s_chtml10_end_h2_tag (void *pdoc, Node *node);
85 static char *s_chtml10_start_h3_tag (void *pdoc, Node *node);
86 static char *s_chtml10_end_h3_tag (void *pdoc, Node *node);
87 static char *s_chtml10_start_h4_tag (void *pdoc, Node *node);
88 static char *s_chtml10_end_h4_tag (void *pdoc, Node *node);
89 static char *s_chtml10_start_h5_tag (void *pdoc, Node *node);
90 static char *s_chtml10_end_h5_tag (void *pdoc, Node *node);
91 static char *s_chtml10_start_h6_tag (void *pdoc, Node *node);
92 static char *s_chtml10_end_h6_tag (void *pdoc, Node *node);
93 static char *s_chtml10_start_head_tag (void *pdoc, Node *node);
94 static char *s_chtml10_end_head_tag (void *pdoc, Node *node);
95 static char *s_chtml10_start_title_tag (void *pdoc, Node *node);
96 static char *s_chtml10_end_title_tag (void *pdoc, Node *node);
97 static char *s_chtml10_start_base_tag (void *pdoc, Node *node);
98 static char *s_chtml10_end_base_tag (void *pdoc, Node *node);
99 static char *s_chtml10_start_body_tag (void *pdoc, Node *node);
100 static char *s_chtml10_end_body_tag (void *pdoc, Node *node);
101 static char *s_chtml10_start_a_tag (void *pdoc, Node *node);
102 static char *s_chtml10_end_a_tag (void *pdoc, Node *node);
103 static char *s_chtml10_start_br_tag (void *pdoc, Node *node);
104 static char *s_chtml10_end_br_tag (void *pdoc, Node *node);
105 static char *s_chtml10_start_tr_tag (void *pdoc, Node *node);
106 static char *s_chtml10_end_tr_tag (void *pdoc, Node *node);
107 static char *s_chtml10_start_input_tag (void *pdoc, Node *node);
108 static char *s_chtml10_end_input_tag (void *pdoc, Node *node);
109 static char *s_chtml10_start_form_tag (void *pdoc, Node *node);
110 static char *s_chtml10_end_form_tag (void *pdoc, Node *node);
111 static char *s_chtml10_start_center_tag (void *pdoc, Node *node);
112 static char *s_chtml10_end_center_tag (void *pdoc, Node *node);
113 static char *s_chtml10_start_hr_tag (void *pdoc, Node *node);
114 static char *s_chtml10_end_hr_tag (void *pdoc, Node *node);
115 static char *s_chtml10_start_img_tag (void *pdoc, Node *node);
116 static char *s_chtml10_end_img_tag (void *pdoc, Node *node);
117 static char *s_chtml10_start_select_tag (void *pdoc, Node *node);
118 static char *s_chtml10_end_select_tag (void *pdoc, Node *node);
119 static char *s_chtml10_start_option_tag (void *pdoc, Node *node);
120 static char *s_chtml10_end_option_tag (void *pdoc, Node *node);
121 static char *s_chtml10_start_div_tag (void *pdoc, Node *node);
122 static char *s_chtml10_end_div_tag (void *pdoc, Node *node);
123 static char *s_chtml10_start_blockquote_tag (void *pdoc, Node *node);
124 static char *s_chtml10_end_blockquote_tag (void *pdoc, Node *node);
125 static char *s_chtml10_start_dir_tag (void *pdoc, Node *node);
126 static char *s_chtml10_end_dir_tag (void *pdoc, Node *node);
127 static char *s_chtml10_start_dl_tag (void *pdoc, Node *node);
128 static char *s_chtml10_end_dl_tag (void *pdoc, Node *node);
129 static char *s_chtml10_start_dt_tag (void *pdoc, Node *node);
130 static char *s_chtml10_end_dt_tag (void *pdoc, Node *node);
131 static char *s_chtml10_start_dd_tag (void *pdoc, Node *node);
132 static char *s_chtml10_end_dd_tag (void *pdoc, Node *node);
133 static char *s_chtml10_start_menu_tag (void *pdoc, Node *node);
134 static char *s_chtml10_end_menu_tag (void *pdoc, Node *node);
135 static char *s_chtml10_start_plaintext_tag (void *pdoc, Node *node);
136 static char *s_chtml10_start_plaintext_tag_inner(void *pdoc, Node *node);
137 static char *s_chtml10_end_plaintext_tag (void *pdoc, Node *node);
138 static char *s_chtml10_link_tag (void *pdoc, Node *node);
139 static char *s_chtml10_style_tag (void *pdoc, Node *node);
140 static char *s_chtml10_newline_mark (void *pdoc, Node *node);
141 static char *s_chtml10_start_span_tag (void *pdoc, Node *node);
142 static char *s_chtml10_end_span_tag (void *pdoc, Node *node);
144 static void s_init_chtml10(chtml10_t *chtml, Doc *doc, request_rec *r, device_table *spec);
146 static int s_chtml10_search_emoji(chtml10_t *chtml, char *txt, char **rslt);
147 static char *s_chtml10_chxjif_tag (void *pdoc, Node *node);
148 static char *s_chtml10_text (void *pdoc, Node *node);
149 static css_prop_list_t *s_chtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
150 static css_prop_list_t *s_chtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
154 tag_handler chtml10_handler[] = {
157 s_chtml10_start_html_tag,
158 s_chtml10_end_html_tag,
162 s_chtml10_start_meta_tag,
163 s_chtml10_end_meta_tag,
167 s_chtml10_start_textarea_tag,
168 s_chtml10_end_textarea_tag,
172 s_chtml10_start_p_tag,
177 s_chtml10_start_pre_tag,
178 s_chtml10_end_pre_tag,
182 s_chtml10_start_ul_tag,
183 s_chtml10_end_ul_tag,
187 s_chtml10_start_li_tag,
188 s_chtml10_end_li_tag,
192 s_chtml10_start_ol_tag,
193 s_chtml10_end_ol_tag,
197 s_chtml10_start_h1_tag,
198 s_chtml10_end_h1_tag,
202 s_chtml10_start_h2_tag,
203 s_chtml10_end_h2_tag,
207 s_chtml10_start_h3_tag,
208 s_chtml10_end_h3_tag,
212 s_chtml10_start_h4_tag,
213 s_chtml10_end_h4_tag,
217 s_chtml10_start_h5_tag,
218 s_chtml10_end_h5_tag,
222 s_chtml10_start_h6_tag,
223 s_chtml10_end_h6_tag,
227 s_chtml10_start_head_tag,
228 s_chtml10_end_head_tag,
232 s_chtml10_start_title_tag,
233 s_chtml10_end_title_tag,
237 s_chtml10_start_base_tag,
238 s_chtml10_end_base_tag,
242 s_chtml10_start_body_tag,
243 s_chtml10_end_body_tag,
247 s_chtml10_start_a_tag,
252 s_chtml10_start_br_tag,
253 s_chtml10_end_br_tag,
262 s_chtml10_start_tr_tag,
263 s_chtml10_end_tr_tag,
282 s_chtml10_start_form_tag,
283 s_chtml10_end_form_tag,
287 s_chtml10_start_input_tag,
288 s_chtml10_end_input_tag,
292 s_chtml10_start_center_tag,
293 s_chtml10_end_center_tag,
297 s_chtml10_start_hr_tag,
298 s_chtml10_end_hr_tag,
302 s_chtml10_start_img_tag,
303 s_chtml10_end_img_tag,
307 s_chtml10_start_select_tag,
308 s_chtml10_end_select_tag,
312 s_chtml10_start_option_tag,
313 s_chtml10_end_option_tag,
317 s_chtml10_start_div_tag,
318 s_chtml10_end_div_tag,
322 s_chtml10_chxjif_tag,
327 s_chtml10_chxjif_tag,
347 s_chtml10_start_span_tag,
348 s_chtml10_end_span_tag,
372 s_chtml10_start_dt_tag,
373 s_chtml10_end_dt_tag,
387 s_chtml10_start_blockquote_tag,
388 s_chtml10_end_blockquote_tag,
392 s_chtml10_start_dir_tag,
393 s_chtml10_end_dir_tag,
397 s_chtml10_start_dl_tag,
398 s_chtml10_end_dl_tag,
402 s_chtml10_start_dd_tag,
403 s_chtml10_end_dd_tag,
407 s_chtml10_start_menu_tag,
408 s_chtml10_end_menu_tag,
412 s_chtml10_start_plaintext_tag,
413 s_chtml10_end_plaintext_tag,
432 s_chtml10_newline_mark,
454 * converts from CHTML5.0 to CHTML1.0.
456 * @param r [i] Requet_rec is appointed.
457 * @param spec [i] The result of the device specification processing which
458 * was done in advance is appointed.
459 * @param src [i] The character string before the converting is appointed.
460 * @return The character string after the converting is returned.
463 chxj_convert_chtml10(
469 chxjconvrule_entry *entryp,
482 DBG(r,"REQ[%X] start %s()",TO_ADDR(r),__func__);
483 DBG(r,"REQ[%X] cookie_id=[%s]", TO_ADDR(r),(cookie) ? cookie->cookie_id : "");
485 /*--------------------------------------------------------------------------*/
487 /*--------------------------------------------------------------------------*/
489 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
491 DBG(r,"REQ[%X] found qrcode xml",TO_ADDR(r));
492 DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
496 /*--------------------------------------------------------------------------*/
497 /* The CHTML structure is initialized. */
498 /*--------------------------------------------------------------------------*/
499 s_init_chtml10(&chtml10, &doc, r, spec);
500 chtml10.entryp = entryp;
501 chtml10.cookie = cookie;
503 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
505 /*--------------------------------------------------------------------------*/
506 /* The character string of the input is analyzed. */
507 /*--------------------------------------------------------------------------*/
508 qs_init_malloc(&doc);
509 qs_init_root_node(&doc);
511 if (IS_CSS_ON(chtml10.entryp)) {
512 /* current property list */
513 chtml10.css_prop_stack = chxj_new_prop_list_stack(&doc);
516 ss = apr_pcalloc(r->pool, srclen + 1);
517 memset(ss, 0, srclen + 1);
518 memcpy(ss, src, srclen);
521 chxj_dump_out("[src] CHTML -> CHTML1.0", ss, srclen);
524 qs_parse_string(&doc,ss, strlen(ss));
526 chxj_buffered_write_init(r->pool, &doc.buf);
527 /*--------------------------------------------------------------------------*/
528 /* It converts it from CHTML to CHTML. */
529 /*--------------------------------------------------------------------------*/
530 chxj_node_convert(spec,r,(void *)&chtml10, &doc, qs_get_root(&doc), 0);
531 chtml10.out = chxj_buffered_write_flush(chtml10.out, &doc.buf);
532 dst = apr_pstrdup(r->pool, chtml10.out);
533 chxj_buffered_write_terminate(&doc.buf);
535 qs_all_free(&doc,QX_LOGMARK);
538 return apr_pstrdup(r->pool,ss);
541 if (strlen(dst) == 0) {
542 dst = apr_psprintf(r->pool, "\n");
544 *dstlen = strlen(dst);
547 chxj_dump_out("[dst] CHTML -> CHTML1.0", dst, *dstlen);
550 DBG(r,"REQ[%X] cookie_id=[%s] time=[%" APR_TIME_T_FMT "]", TO_ADDR(r), (cookie) ? cookie->cookie_id : "", apr_time_now() - t);
551 DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
558 * The CHTML structure is initialized.
560 * @param chtml10 [i/o] The pointer to the HDML structure that wants to be
561 * initialized is specified.
562 * @param doc [i] The Doc structure that should be set to the initialized
563 * HDML structure is specified.
564 * @param r [i] To use POOL, the pointer to request_rec is specified.
565 * @param spec [i] The pointer to the device_table
574 memset(doc, 0, sizeof(Doc));
575 memset(chtml10, 0, sizeof(chtml10_t));
579 chtml10->spec = spec;
580 chtml10->out = qs_alloc_zero_byte_string(r->pool);
581 chtml10->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
582 chtml10->doc->parse_mode = PARSE_MODE_CHTML;
583 chtml10->style = NULL;
588 * Corresponding EMOJI to a current character-code is retrieved.
589 * The substitution character string is stored in the rslt pointer if agreeing.
591 * @param chtml10 [i] The pointer to the CHTML structure is specified.
592 * @param txt [i] The character string to want to examine whether it is
593 * EMOJI is specified.
594 * @param rslt [o] The pointer to the pointer that stores the result is
596 * @return When corresponding EMOJI exists, it returns it excluding 0.
599 s_chtml10_search_emoji(chtml10_t *chtml10, char *txt, char **rslt)
606 spec = chtml10->spec;
612 DBG(r,"REQ[%X] spec is NULL",TO_ADDR(r));
615 for (ee = chtml10->conf->emoji;
620 DBG(r,"REQ[%X] emoji->imode is NULL",TO_ADDR(r));
624 if (ee->imode->string
626 && strlen(ee->imode->string) > 0
627 && *ee->imode->string == *txt
628 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
629 *rslt = apr_palloc(r->pool, 3);
630 (*rslt)[0] = ee->imode->hex1byte & 0xff;
631 (*rslt)[1] = ee->imode->hex2byte & 0xff;
633 return strlen(ee->imode->string);
640 chxj_chtml10_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
651 chtml10 = &__chtml10;
654 DBG(r, "REQ[%X] start %s()", TO_ADDR(r),__func__);
655 memset(doc, 0, sizeof(Doc));
656 memset(chtml10, 0, sizeof(chtml10_t));
660 chtml10->spec = spec;
661 chtml10->out = qs_alloc_zero_byte_string(r->pool);
662 chtml10->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
663 chtml10->doc->parse_mode = PARSE_MODE_CHTML;
665 apr_pool_create(&pool, r->pool);
667 chxj_buffered_write_init(pool, &doc->buf);
669 for (ii=0; ii<len; ii++) {
673 rtn = s_chtml10_search_emoji(chtml10, (char *)&src[ii], &out);
680 if (is_sjis_kanji(src[ii])) {
681 two_byte[0] = src[ii+0];
682 two_byte[1] = src[ii+1];
688 one_byte[0] = src[ii+0];
694 chtml10->out = chxj_buffered_write_flush(chtml10->out, &doc->buf);
696 DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
702 * It is a handler who processes the HTML tag.
704 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
705 * destination is specified.
706 * @param node [i] The HTML tag node is specified.
707 * @return The conversion result is returned.
710 s_chtml10_start_html_tag(void *pdoc, Node *UNUSED(node))
716 chtml10 = GET_CHTML10(pdoc);
720 /*--------------------------------------------------------------------------*/
722 /*--------------------------------------------------------------------------*/
729 * It is a handler who processes the HTML tag.
731 * @param pdoc [i/o] The pointer to the CHTML structure at the output
732 * destination is specified.
733 * @param node [i] The HTML tag node is specified.
734 * @return The conversion result is returned.
737 s_chtml10_end_html_tag(void *pdoc, Node *UNUSED(child))
744 chtml10 = GET_CHTML10(pdoc);
748 if (IS_CSS_ON(chtml10->entryp)) {
749 chxj_css_pop_prop_list(chtml10->css_prop_stack);
758 * It is a handler who processes the META tag.
760 * @param pdoc [i/o] The pointer to the CHTML structure at the output
761 * destination is specified.
762 * @param node [i] The META tag node is specified.
763 * @return The conversion result is returned.
766 s_chtml10_start_meta_tag(void *pdoc, Node *UNUSED(node))
768 chtml10_t *chtml10 = GET_CHTML10(pdoc);
777 * It is a handler who processes the META tag.
779 * @param pdoc [i/o] The pointer to the CHTML structure at the output
780 * destination is specified.
781 * @param node [i] The META tag node is specified.
782 * @return The conversion result is returned.
785 s_chtml10_end_meta_tag(void *pdoc, Node *UNUSED(child))
787 chtml10_t *chtml10 = GET_CHTML10(pdoc);
794 * It is a handler who processes the HEAD tag.
796 * @param pdoc [i/o] The pointer to the CHTML structure at the output
797 * destination is specified.
798 * @param node [i] The HEAD tag node is specified.
799 * @return The conversion result is returned.
802 s_chtml10_start_head_tag(void *pdoc, Node *UNUSED(node))
808 chtml10 = GET_CHTML10(pdoc);
819 * It is a handler who processes the HEAD tag.
821 * @param pdoc [i/o] The pointer to the CHTML structure at the output
822 * destination is specified.
823 * @param node [i] The HEAD tag node is specified.
824 * @return The conversion result is returned.
827 s_chtml10_end_head_tag(void *pdoc, Node *UNUSED(child))
833 chtml10 = GET_CHTML10(pdoc);
844 * It is a handler who processes the OL tag.
846 * @param pdoc [i/o] The pointer to the CHTML structure at the output
847 * destination is specified.
848 * @param node [i] The OL tag node is specified.
849 * @return The conversion result is returned.
852 s_chtml10_start_ol_tag(void *pdoc, Node *node)
858 char *attr_style = NULL;
860 chtml10 = GET_CHTML10(pdoc);
864 for (attr = qs_get_attr(doc,node);
866 attr = qs_get_next_attr(doc,attr)) {
867 char *nm = qs_get_attr_name(doc,attr);
868 char *val = qs_get_attr_value(doc,attr);
869 if (val && STRCASEEQ('s','S',"style", nm)) {
874 if (IS_CSS_ON(chtml10->entryp)) {
875 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
885 * It is a handler who processes the OL tag.
887 * @param pdoc [i/o] The pointer to the CHTML structure at the output
888 * destination is specified.
889 * @param node [i] The OL tag node is specified.
890 * @return The conversion result is returned.
893 s_chtml10_end_ol_tag(void *pdoc, Node *UNUSED(child))
899 chtml10 = GET_CHTML10(pdoc);
904 if (IS_CSS_ON(chtml10->entryp)) {
905 chxj_css_pop_prop_list(chtml10->css_prop_stack);
913 * It is a handler who processes the UL tag.
915 * @param pdoc [i/o] The pointer to the CHTML structure at the output
916 * destination is specified.
917 * @param node [i] The UL tag node is specified.
918 * @return The conversion result is returned.
921 s_chtml10_start_ul_tag(void *pdoc, Node *node)
927 char *attr_style = NULL;
929 chtml10 = GET_CHTML10(pdoc);
934 for (attr = qs_get_attr(doc,node);
936 attr = qs_get_next_attr(doc,attr)) {
937 char *nm = qs_get_attr_name(doc,attr);
938 char *val = qs_get_attr_value(doc,attr);
939 if (val && STRCASEEQ('s','S',"style", nm)) {
944 if (IS_CSS_ON(chtml10->entryp)) {
945 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
955 * It is a handler who processes the UL tag.
957 * @param pdoc [i/o] The pointer to the CHTML structure at the output
958 * destination is specified.
959 * @param node [i] The UL tag node is specified.
960 * @return The conversion result is returned.
963 s_chtml10_end_ul_tag(void *pdoc, Node *UNUSED(child))
969 chtml10 = GET_CHTML10(pdoc);
974 if (IS_CSS_ON(chtml10->entryp)) {
975 chxj_css_pop_prop_list(chtml10->css_prop_stack);
983 * It is a handler who processes the LI tag.
985 * @param pdoc [i/o] The pointer to the CHTML structure at the output
986 * destination is specified.
987 * @param node [i] The LI tag node is specified.
988 * @return The conversion result is returned.
991 s_chtml10_start_li_tag(void *pdoc, Node *node)
997 char *attr_style = NULL;
999 chtml10 = GET_CHTML10(pdoc);
1003 for (attr = qs_get_attr(doc,node);
1005 attr = qs_get_next_attr(doc,attr)) {
1006 char *nm = qs_get_attr_name(doc,attr);
1007 char *val = qs_get_attr_value(doc,attr);
1008 if (val && STRCASEEQ('s','S',"style", nm)) {
1013 if (IS_CSS_ON(chtml10->entryp)) {
1014 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1018 return chtml10->out;
1023 * It is a handler who processes the LI tag.
1025 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1026 * destination is specified.
1027 * @param node [i] The LI tag node is specified.
1028 * @return The conversion result is returned.
1031 s_chtml10_end_li_tag(void *pdoc, Node *UNUSED(child))
1033 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1034 if (IS_CSS_ON(chtml10->entryp)) {
1035 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1037 return chtml10->out;
1042 * It is a handler who processes the H1 tag.
1044 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1045 * destination is specified.
1046 * @param node [i] The H1 tag node is specified.
1047 * @return The conversion result is returned.
1050 s_chtml10_start_h1_tag(void *pdoc, Node *node)
1056 char *attr_style = NULL;
1057 char *attr_align = NULL;
1059 chtml10 = GET_CHTML10(pdoc);
1063 for (attr = qs_get_attr(doc,node);
1065 attr = qs_get_next_attr(doc,attr)) {
1066 char *name = qs_get_attr_name(doc,attr);
1067 char *value = qs_get_attr_value(doc,attr);
1068 if (STRCASEEQ('a','A',"align", name)) {
1069 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1073 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1077 if (IS_CSS_ON(chtml10->entryp)) {
1078 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1080 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1081 css_property_t *cur;
1082 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1083 if (STRCASEEQ('l','L',"left", cur->value)) {
1084 attr_align = apr_pstrdup(doc->pool, "left");
1086 else if (STRCASEEQ('c','C',"center",cur->value)) {
1087 attr_align = apr_pstrdup(doc->pool, "center");
1089 else if (STRCASEEQ('r','R',"right",cur->value)) {
1090 attr_align = apr_pstrdup(doc->pool, "right");
1103 return chtml10->out;
1108 * It is a handler who processes the H1 tag.
1110 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1111 * destination is specified.
1112 * @param node [i] The H1 tag node is specified.
1113 * @return The conversion result is returned.
1116 s_chtml10_end_h1_tag(void *pdoc, Node *UNUSED(child))
1122 chtml10 = GET_CHTML10(pdoc);
1127 if (IS_CSS_ON(chtml10->entryp)) {
1128 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1131 return chtml10->out;
1136 * It is a handler who processes the H2 tag.
1138 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1139 * destination is specified.
1140 * @param node [i] The H2 tag node is specified.
1141 * @return The conversion result is returned.
1144 s_chtml10_start_h2_tag(void *pdoc, Node *node)
1149 char *attr_style = NULL;
1150 char *attr_align = NULL;
1152 chtml10 = GET_CHTML10(pdoc);
1155 for (attr = qs_get_attr(doc,node);
1157 attr = qs_get_next_attr(doc,attr)) {
1158 char *name = qs_get_attr_name(doc,attr);
1159 char *value = qs_get_attr_value(doc,attr);
1160 if (STRCASEEQ('a','A',"align", name)) {
1161 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1165 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1169 if (IS_CSS_ON(chtml10->entryp)) {
1170 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1172 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1173 css_property_t *cur;
1174 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1175 if (STRCASEEQ('l','L',"left", cur->value)) {
1176 attr_align = apr_pstrdup(doc->pool, "left");
1178 else if (STRCASEEQ('c','C',"center",cur->value)) {
1179 attr_align = apr_pstrdup(doc->pool, "center");
1181 else if (STRCASEEQ('r','R',"right",cur->value)) {
1182 attr_align = apr_pstrdup(doc->pool, "right");
1195 return chtml10->out;
1200 * It is a handler who processes the H2 tag.
1202 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1203 * destination is specified.
1204 * @param node [i] The H2 tag node is specified.
1205 * @return The conversion result is returned.
1208 s_chtml10_end_h2_tag(void *pdoc, Node *UNUSED(child))
1214 chtml10 = GET_CHTML10(pdoc);
1219 if (IS_CSS_ON(chtml10->entryp)) {
1220 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1223 return chtml10->out;
1228 * It is a handler who processes the H3 tag.
1230 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1231 * destination is specified.
1232 * @param node [i] The H3 tag node is specified.
1233 * @return The conversion result is returned.
1236 s_chtml10_start_h3_tag(void *pdoc, Node *node)
1241 char *attr_style = NULL;
1242 char *attr_align = NULL;
1244 chtml10 = GET_CHTML10(pdoc);
1247 for (attr = qs_get_attr(doc,node);
1249 attr = qs_get_next_attr(doc,attr)) {
1250 char *name = qs_get_attr_name(doc,attr);
1251 char *value = qs_get_attr_value(doc,attr);
1252 if (STRCASEEQ('a','A',"align", name)) {
1253 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1257 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1261 if (IS_CSS_ON(chtml10->entryp)) {
1262 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1264 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1265 css_property_t *cur;
1266 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1267 if (STRCASEEQ('l','L',"left", cur->value)) {
1268 attr_align = apr_pstrdup(doc->pool, "left");
1270 else if (STRCASEEQ('c','C',"center",cur->value)) {
1271 attr_align = apr_pstrdup(doc->pool, "center");
1273 else if (STRCASEEQ('r','R',"right",cur->value)) {
1274 attr_align = apr_pstrdup(doc->pool, "right");
1287 return chtml10->out;
1292 * It is a handler who processes the H3 tag.
1294 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1295 * destination is specified.
1296 * @param node [i] The H3 tag node is specified.
1297 * @return The conversion result is returned.
1300 s_chtml10_end_h3_tag(void *pdoc, Node *UNUSED(child))
1306 chtml10 = GET_CHTML10(pdoc);
1311 if (IS_CSS_ON(chtml10->entryp)) {
1312 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1315 return chtml10->out;
1320 * It is a handler who processes the H4 tag.
1322 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1323 * destination is specified.
1324 * @param node [i] The H4 tag node is specified.
1325 * @return The conversion result is returned.
1328 s_chtml10_start_h4_tag(void *pdoc, Node *node)
1333 char *attr_style = NULL;
1334 char *attr_align = NULL;
1336 chtml10 = GET_CHTML10(pdoc);
1339 for (attr = qs_get_attr(doc,node);
1341 attr = qs_get_next_attr(doc,attr)) {
1342 char *name = qs_get_attr_name(doc,attr);
1343 char *value = qs_get_attr_value(doc,attr);
1344 if (STRCASEEQ('a','A',"align", name)) {
1345 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1349 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1353 if (IS_CSS_ON(chtml10->entryp)) {
1354 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1356 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1357 css_property_t *cur;
1358 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1359 if (STRCASEEQ('l','L',"left", cur->value)) {
1360 attr_align = apr_pstrdup(doc->pool, "left");
1362 else if (STRCASEEQ('c','C',"center",cur->value)) {
1363 attr_align = apr_pstrdup(doc->pool, "center");
1365 else if (STRCASEEQ('r','R',"right",cur->value)) {
1366 attr_align = apr_pstrdup(doc->pool, "right");
1379 return chtml10->out;
1384 * It is a handler who processes the H4 tag.
1386 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1387 * destination is specified.
1388 * @param node [i] The H4 tag node is specified.
1389 * @return The conversion result is returned.
1392 s_chtml10_end_h4_tag(void *pdoc, Node *UNUSED(child))
1397 chtml10 = GET_CHTML10(pdoc);
1401 if (IS_CSS_ON(chtml10->entryp)) {
1402 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1405 return chtml10->out;
1410 * It is a handler who processes the H5 tag.
1412 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1413 * destination is specified.
1414 * @param node [i] The H5 tag node is specified.
1415 * @return The conversion result is returned.
1418 s_chtml10_start_h5_tag(void *pdoc, Node *node)
1423 char *attr_style = NULL;
1424 char *attr_align = NULL;
1426 chtml10 = GET_CHTML10(pdoc);
1429 for (attr = qs_get_attr(doc,node);
1431 attr = qs_get_next_attr(doc,attr)) {
1432 char *name = qs_get_attr_name(doc,attr);
1433 char *value = qs_get_attr_value(doc,attr);
1434 if (STRCASEEQ('a','A',"align", name)) {
1435 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1439 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1443 if (IS_CSS_ON(chtml10->entryp)) {
1444 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1446 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1447 css_property_t *cur;
1448 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1449 if (STRCASEEQ('l','L',"left", cur->value)) {
1450 attr_align = apr_pstrdup(doc->pool, "left");
1452 else if (STRCASEEQ('c','C',"center",cur->value)) {
1453 attr_align = apr_pstrdup(doc->pool, "center");
1455 else if (STRCASEEQ('r','R',"right",cur->value)) {
1456 attr_align = apr_pstrdup(doc->pool, "right");
1469 return chtml10->out;
1474 * It is a handler who processes the H5 tag.
1476 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1477 * destination is specified.
1478 * @param node [i] The H5 tag node is specified.
1479 * @return The conversion result is returned.
1482 s_chtml10_end_h5_tag(void *pdoc, Node *UNUSED(child))
1487 chtml10 = GET_CHTML10(pdoc);
1491 if (IS_CSS_ON(chtml10->entryp)) {
1492 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1495 return chtml10->out;
1500 * It is a handler who processes the H6 tag.
1502 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1503 * destination is specified.
1504 * @param node [i] The H6 tag node is specified.
1505 * @return The conversion result is returned.
1508 s_chtml10_start_h6_tag(void *pdoc, Node *node)
1513 char *attr_style = NULL;
1514 char *attr_align = NULL;
1516 chtml10 = GET_CHTML10(pdoc);
1519 for (attr = qs_get_attr(doc,node);
1521 attr = qs_get_next_attr(doc,attr)) {
1522 char *name = qs_get_attr_name(doc,attr);
1523 char *value = qs_get_attr_value(doc,attr);
1524 if (STRCASEEQ('a','A',"align", name)) {
1525 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1529 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1533 if (IS_CSS_ON(chtml10->entryp)) {
1534 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1536 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1537 css_property_t *cur;
1538 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1539 if (STRCASEEQ('l','L',"left", cur->value)) {
1540 attr_align = apr_pstrdup(doc->pool, "left");
1542 else if (STRCASEEQ('c','C',"center",cur->value)) {
1543 attr_align = apr_pstrdup(doc->pool, "center");
1545 else if (STRCASEEQ('r','R',"right",cur->value)) {
1546 attr_align = apr_pstrdup(doc->pool, "right");
1559 return chtml10->out;
1564 * It is a handler who processes the H6 tag.
1566 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1567 * destination is specified.
1568 * @param node [i] The H6 tag node is specified.
1569 * @return The conversion result is returned.
1572 s_chtml10_end_h6_tag(void *pdoc, Node *UNUSED(child))
1577 chtml10 = GET_CHTML10(pdoc);
1581 if (IS_CSS_ON(chtml10->entryp)) {
1582 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1585 return chtml10->out;
1590 * It is a handler who processes the TITLE tag.
1592 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1593 * destination is specified.
1594 * @param node [i] The TITLE tag node is specified.
1595 * @return The conversion result is returned.
1598 s_chtml10_start_title_tag(void *pdoc, Node *node)
1603 chtml10 = GET_CHTML10(pdoc);
1608 if (chtml10->conf->use_google_analytics) {
1609 chtml10->pagetitle = "";
1611 for (child = qs_get_child_node(doc,node);
1613 child = qs_get_next_node(doc,child)) {
1614 char *textval = qs_get_node_value(doc,child);
1615 chtml10->pagetitle = apr_pstrcat(doc->r->pool, chtml10->pagetitle, textval, NULL);
1619 return chtml10->out;
1624 * It is a handler who processes the TITLE tag.
1626 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1627 * destination is specified.
1628 * @param node [i] The TITLE tag node is specified.
1629 * @return The conversion result is returned.
1632 s_chtml10_end_title_tag(void *pdoc, Node *UNUSED(child))
1637 chtml10 = GET_CHTML10(pdoc);
1642 return chtml10->out;
1647 * It is a handler who processes the BASE tag.
1649 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1650 * destination is specified.
1651 * @param node [i] The BASE tag node is specified.
1652 * @return The conversion result is returned.
1655 s_chtml10_start_base_tag(void *pdoc, Node *node)
1661 chtml10 = GET_CHTML10(pdoc);
1665 /*--------------------------------------------------------------------------*/
1666 /* Get Attributes */
1667 /*--------------------------------------------------------------------------*/
1668 for (attr = qs_get_attr(doc,node);
1670 attr = qs_get_next_attr(doc,attr)) {
1671 char *name = qs_get_attr_name(doc,attr);
1672 char *value = qs_get_attr_value(doc,attr);
1673 if (STRCASEEQ('h','H',"href", name)) {
1682 return chtml10->out;
1687 * It is a handler who processes the BASE tag.
1689 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1690 * destination is specified.
1691 * @param node [i] The BASE tag node is specified.
1692 * @return The conversion result is returned.
1695 s_chtml10_end_base_tag(void *pdoc, Node *UNUSED(child))
1697 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1699 return chtml10->out;
1704 * It is a handler who processes the BODY tag.
1706 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1707 * destination is specified.
1708 * @param node [i] The BODY tag node is specified.
1709 * @return The conversion result is returned.
1712 s_chtml10_start_body_tag(void *pdoc, Node *node)
1717 char *attr_style = NULL;
1719 chtml10 = GET_CHTML10(pdoc);
1722 /*--------------------------------------------------------------------------*/
1723 /* Get Attributes */
1724 /*--------------------------------------------------------------------------*/
1725 for (attr = qs_get_attr(doc,node);
1727 attr = qs_get_next_attr(doc,attr)) {
1728 char *name = qs_get_attr_name(doc,attr);
1729 char *value = qs_get_attr_value(doc,attr);
1733 if (strcasecmp(name, "alink") == 0) {
1734 /*----------------------------------------------------------------------*/
1736 /*----------------------------------------------------------------------*/
1743 if (strcasecmp(name, "bgcolor") == 0) {
1744 /*----------------------------------------------------------------------*/
1746 /*----------------------------------------------------------------------*/
1753 if (strcasecmp(name, "text") == 0) {
1754 /*----------------------------------------------------------------------*/
1756 /*----------------------------------------------------------------------*/
1763 if (strcasecmp(name, "link") == 0) {
1764 /*----------------------------------------------------------------------*/
1766 /*----------------------------------------------------------------------*/
1773 if (strcasecmp(name, "vlink") == 0) {
1774 /*----------------------------------------------------------------------*/
1776 /*----------------------------------------------------------------------*/
1783 if (strcasecmp("style", name) == 0 && value && *value) {
1793 if (IS_CSS_ON(chtml10->entryp)) {
1794 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1799 return chtml10->out;
1804 * It is a handler who processes the BODY tag.
1806 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1807 * destination is specified.
1808 * @param node [i] The BODY tag node is specified.
1809 * @return The conversion result is returned.
1812 s_chtml10_end_body_tag(void *pdoc, Node *UNUSED(child))
1817 chtml10 = GET_CHTML10(pdoc);
1820 if (chtml10->conf->use_google_analytics) {
1821 char *src = chxj_google_analytics_get_image_url(doc->r, chtml10->pagetitle);
1828 if (IS_CSS_ON(chtml10->entryp)) {
1829 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1832 return chtml10->out;
1837 * It is a handler who processes the A tag.
1839 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1840 * destination is specified.
1841 * @param node [i] The A tag node is specified.
1842 * @return The conversion result is returned.
1845 s_chtml10_start_a_tag(void *pdoc, Node *node)
1851 char *attr_style = NULL;
1853 chtml10 = GET_CHTML10(pdoc);
1859 /*--------------------------------------------------------------------------*/
1860 /* Get Attributes */
1861 /*--------------------------------------------------------------------------*/
1862 for (attr = qs_get_attr(doc,node);
1864 attr = qs_get_next_attr(doc,attr)) {
1865 char *name = qs_get_attr_name(doc,attr);
1866 char *value = qs_get_attr_value(doc,attr);
1870 if (strcasecmp(name, "name") == 0) {
1871 /*--------------------------------------------------------------------*/
1873 /*--------------------------------------------------------------------*/
1882 if (strcasecmp(name, "href") == 0) {
1883 /*--------------------------------------------------------------------*/
1885 /*--------------------------------------------------------------------*/
1886 value = chxj_encoding_parameter(r, value, 0);
1887 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1888 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1898 if (strcasecmp(name, "accesskey") == 0) {
1899 /*--------------------------------------------------------------------*/
1901 /*--------------------------------------------------------------------*/
1902 W_L(" accesskey=\"");
1910 if (strcasecmp(name, "cti") == 0) {
1911 /*--------------------------------------------------------------------*/
1913 /*--------------------------------------------------------------------*/
1920 if (strcasecmp(name, "utn") == 0) {
1921 /*--------------------------------------------------------------------*/
1923 /*--------------------------------------------------------------------*/
1930 if (strcasecmp(name, "telbook") == 0) {
1931 /*--------------------------------------------------------------------*/
1933 /*--------------------------------------------------------------------*/
1940 if (strcasecmp(name, "kana") == 0) {
1941 /*--------------------------------------------------------------------*/
1943 /*--------------------------------------------------------------------*/
1950 if (strcasecmp(name, "email") == 0) {
1951 /*--------------------------------------------------------------------*/
1953 /*--------------------------------------------------------------------*/
1960 if (strcasecmp(name, "ista") == 0) {
1961 /*--------------------------------------------------------------------*/
1963 /*--------------------------------------------------------------------*/
1967 if (strcasecmp(name, "ilet") == 0) {
1968 /*--------------------------------------------------------------------*/
1970 /*--------------------------------------------------------------------*/
1974 if (strcasecmp(name, "iswf") == 0) {
1975 /*--------------------------------------------------------------------*/
1977 /*--------------------------------------------------------------------*/
1981 if (strcasecmp(name, "irst") == 0) {
1982 /*--------------------------------------------------------------------*/
1984 /*--------------------------------------------------------------------*/
1988 if (strcasecmp(name, "ijam") == 0) {
1989 /*--------------------------------------------------------------------*/
1991 /*--------------------------------------------------------------------*/
1998 if (strcasecmp(name, "style") == 0 && value && *value) {
2010 if (IS_CSS_ON(chtml10->entryp)) {
2011 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2013 return chtml10->out;
2018 * It is a handler who processes the A tag.
2020 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2021 * destination is specified.
2022 * @param node [i] The A tag node is specified.
2023 * @return The conversion result is returned.
2026 s_chtml10_end_a_tag(void *pdoc, Node *UNUSED(child))
2032 chtml10 = GET_CHTML10(pdoc);
2038 if (IS_CSS_ON(chtml10->entryp)) {
2039 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2042 return chtml10->out;
2047 * It is a handler who processes the BR tag.
2049 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2050 * destination is specified.
2051 * @param node [i] The BR tag node is specified.
2052 * @return The conversion result is returned.
2055 s_chtml10_start_br_tag(void *pdoc, Node *node)
2062 chtml10 = GET_CHTML10(pdoc);
2068 /*--------------------------------------------------------------------------*/
2069 /* Get Attributes */
2070 /*--------------------------------------------------------------------------*/
2071 for (attr = qs_get_attr(doc,node);
2073 attr = qs_get_next_attr(doc,attr)) {
2074 char *name = qs_get_attr_name(doc,attr);
2075 char *value = qs_get_attr_value(doc,attr);
2076 if (STRCASEEQ('c','C',"clear",name)) {
2077 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
2086 return chtml10->out;
2091 * It is a handler who processes the BR tag.
2093 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2094 * destination is specified.
2095 * @param node [i] The BR tag node is specified.
2096 * @return The conversion result is returned.
2099 s_chtml10_end_br_tag(void *pdoc, Node *UNUSED(child))
2101 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2103 return chtml10->out;
2108 * It is a handler who processes the TR tag.
2110 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2111 * destination is specified.
2112 * @param node [i] The TR tag node is specified.
2113 * @return The conversion result is returned.
2116 s_chtml10_start_tr_tag(void *pdoc, Node *UNUSED(node))
2118 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2120 return chtml10->out;
2125 * It is a handler who processes the TR tag.
2127 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2128 * destination is specified.
2129 * @param node [i] The TR tag node is specified.
2130 * @return The conversion result is returned.
2133 s_chtml10_end_tr_tag(void *pdoc, Node *UNUSED(child))
2139 chtml10 = GET_CHTML10(pdoc);
2145 return chtml10->out;
2150 * It is a handler who processes the FORM tag.
2152 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2153 * destination is specified.
2154 * @param node [i] The FORM tag node is specified.
2155 * @return The conversion result is returned.
2158 s_chtml10_start_form_tag(void *pdoc, Node *node)
2164 char *attr_style = NULL;
2165 char *attr_action = NULL;
2166 char *attr_method = NULL;
2167 char *new_hidden_tag = NULL;
2169 chtml10 = GET_CHTML10(pdoc);
2173 /*--------------------------------------------------------------------------*/
2174 /* Get Attributes */
2175 /*--------------------------------------------------------------------------*/
2176 for (attr = qs_get_attr(doc,node);
2178 attr = qs_get_next_attr(doc,attr)) {
2179 char *name = qs_get_attr_name(doc,attr);
2180 char *value = qs_get_attr_value(doc,attr);
2184 if (strcasecmp(name, "action") == 0) {
2185 /*--------------------------------------------------------------------*/
2187 /*--------------------------------------------------------------------*/
2188 attr_action = chxj_encoding_parameter(r, value, 0);
2189 attr_action = chxj_add_cookie_parameter(r, attr_action, chtml10->cookie);
2195 if (strcasecmp(name, "method") == 0) {
2196 /*--------------------------------------------------------------------*/
2198 /*--------------------------------------------------------------------*/
2199 attr_method = value;
2205 if (strcasecmp(name, "utn") == 0) {
2206 /*--------------------------------------------------------------------*/
2208 /*--------------------------------------------------------------------*/
2215 if (strcasecmp(name, "style") == 0 && value && *value) {
2224 if (IS_CSS_ON(chtml10->entryp)) {
2225 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2227 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
2232 char *new_query_string = NULL;
2233 q = strchr(attr_action, '?');
2235 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE, CHXJ_FALSE, chtml10->entryp);
2236 if (new_hidden_tag || new_query_string) {
2242 if (new_query_string) {
2244 W_V(new_query_string);
2254 if (new_hidden_tag) {
2255 W_V(new_hidden_tag);
2258 return chtml10->out;
2263 * It is a handler who processes the FORM tag.
2265 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2266 * destination is specified.
2267 * @param node [i] The FORM tag node is specified.
2268 * @return The conversion result is returned.
2271 s_chtml10_end_form_tag(void *pdoc, Node *UNUSED(child))
2277 chtml10 = GET_CHTML10(pdoc);
2282 if (IS_CSS_ON(chtml10->entryp)) {
2283 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2286 return chtml10->out;
2291 * It is a handler who processes the INPUT tag.
2293 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2294 * destination is specified.
2295 * @param node [i] The INPUT tag node is specified.
2296 * @return The conversion result is returned.
2299 s_chtml10_start_input_tag(void *pdoc, Node *node)
2313 chtml10 = GET_CHTML10(pdoc);
2328 /*--------------------------------------------------------------------------*/
2329 /* Get Attributes */
2330 /*--------------------------------------------------------------------------*/
2332 type = qs_get_type_attr(doc, node, doc->buf.pool);
2333 name = qs_get_name_attr(doc, node, doc->buf.pool);
2334 value = qs_get_value_attr(doc,node,doc->buf.pool);
2335 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
2336 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
2337 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
2338 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
2339 size = qs_get_size_attr(doc, node, doc->buf.pool);
2342 type = qs_trim_string(doc->buf.pool, type);
2343 if (type && (STRCASEEQ('t','T',"text", type) ||
2344 STRCASEEQ('p','P',"password",type) ||
2345 STRCASEEQ('c','C',"checkbox",type) ||
2346 STRCASEEQ('r','R',"radio", type) ||
2347 STRCASEEQ('h','H',"hidden", type) ||
2348 STRCASEEQ('s','S',"submit", type) ||
2349 STRCASEEQ('r','R',"reset", type))) {
2356 if (size && *size != 0) {
2362 if (name && *name != 0) {
2368 if (value && *value != 0) {
2369 if (type && (STRCASEEQ('s','S',"submit",type) || STRCASEEQ('r','R',"reset",type))) {
2370 apr_size_t value_len = strlen(value);
2371 value = chxj_conv_z2h(r, value, &value_len, chtml10->entryp);
2375 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
2379 if (accesskey && *accesskey != 0) {
2380 W_L(" accesskey=\"");
2386 /*------------------------------------------------------------------------*/
2388 /*------------------------------------------------------------------------*/
2391 /*--------------------------------------------------------------------------*/
2392 /* The figure is default for the password. */
2393 /*--------------------------------------------------------------------------*/
2394 if (max_length && *max_length != 0) {
2395 W_L(" maxlength=\"");
2405 return chtml10->out;
2410 * It is a handler who processes the INPUT tag.
2412 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2413 * destination is specified.
2414 * @param node [i] The INPUT tag node is specified.
2415 * @return The conversion result is returned.
2418 s_chtml10_end_input_tag(void *pdoc, Node *UNUSED(child))
2420 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2422 return chtml10->out;
2427 * It is a handler who processes the CENTER tag.
2429 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2430 * destination is specified.
2431 * @param node [i] The CENTER tag node is specified.
2432 * @return The conversion result is returned.
2435 s_chtml10_start_center_tag(void *pdoc, Node *node)
2441 char *attr_style = NULL;
2443 chtml10 = GET_CHTML10(pdoc);
2447 for (attr = qs_get_attr(doc,node);
2449 attr = qs_get_next_attr(doc,attr)) {
2450 char *name = qs_get_attr_name(doc,attr);
2451 char *value = qs_get_attr_value(doc,attr);
2452 if (STRCASEEQ('s','S',"style",name) && value && *value) {
2458 if (IS_CSS_ON(chtml10->entryp)) {
2459 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2462 return chtml10->out;
2467 * It is a handler who processes the CENTER tag.
2469 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2470 * destination is specified.
2471 * @param node [i] The CENTER tag node is specified.
2472 * @return The conversion result is returned.
2475 s_chtml10_end_center_tag(void *pdoc, Node *UNUSED(child))
2481 chtml10 = GET_CHTML10(pdoc);
2486 if (IS_CSS_ON(chtml10->entryp)) {
2487 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2490 return chtml10->out;
2495 * It is a handler who processes the HR tag.
2497 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2498 * destination is specified.
2499 * @param node [i] The HR tag node is specified.
2500 * @return The conversion result is returned.
2503 s_chtml10_start_hr_tag(void *pdoc, Node *node)
2509 char *attr_align = NULL;
2510 char *attr_size = NULL;
2511 char *attr_width = NULL;
2512 char *attr_noshade = NULL;
2513 char *attr_style = NULL;
2515 chtml10 = GET_CHTML10(pdoc);
2519 for (attr = qs_get_attr(doc,node);
2521 attr = qs_get_next_attr(doc,attr)) {
2522 char *name = qs_get_attr_name (doc,attr);
2523 char *value = qs_get_attr_value(doc,attr);
2527 if (strcasecmp(name, "align") == 0) {
2528 /*--------------------------------------------------------------------*/
2530 /*--------------------------------------------------------------------*/
2531 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2539 if (strcasecmp(name, "size") == 0) {
2540 /*--------------------------------------------------------------------*/
2542 /*--------------------------------------------------------------------*/
2543 if (value && *value) {
2547 else if (strcasecmp(name, "style") == 0) {
2548 if (value && *value) {
2556 if (strcasecmp(name, "width") == 0) {
2557 /*--------------------------------------------------------------------*/
2559 /*--------------------------------------------------------------------*/
2560 if (value && *value) {
2568 if (strcasecmp(name, "noshade") == 0) {
2569 /*--------------------------------------------------------------------*/
2571 /*--------------------------------------------------------------------*/
2572 attr_noshade = apr_pstrdup(doc->pool, "noshade");
2578 if (strcasecmp(name, "color") == 0) {
2579 /*--------------------------------------------------------------------*/
2581 /*--------------------------------------------------------------------*/
2590 if (IS_CSS_ON(chtml10->entryp)) {
2591 css_prop_list_t *style = s_chtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2593 css_property_t *border_style_prop = chxj_css_get_property_value(doc, style, "border-style");
2594 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
2595 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
2596 css_property_t *cur;
2597 for (cur = border_style_prop->next; cur != border_style_prop; cur = cur->next) {
2598 if (STRCASEEQ('s','S',"solid",cur->value)) {
2599 attr_noshade = "noshade";
2602 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
2603 char *tmp = apr_pstrdup(doc->pool, cur->value);
2604 char *tmpp = strstr(tmp, "px");
2607 attr_size = apr_pstrdup(doc->pool, tmp);
2610 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
2611 char *tmp = apr_pstrdup(doc->pool, cur->value);
2612 char *tmpp = strstr(tmp, "px");
2615 attr_width = apr_pstrdup(doc->pool, tmp);
2618 tmpp = strstr(tmp, "%");
2620 attr_width = apr_pstrdup(doc->pool, tmp);
2646 return chtml10->out;
2651 * It is a handler who processes the HR tag.
2653 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2654 * destination is specified.
2655 * @param node [i] The HR tag node is specified.
2656 * @return The conversion result is returned.
2659 s_chtml10_end_hr_tag(void *pdoc, Node *UNUSED(child))
2661 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2663 return chtml10->out;
2668 * It is a handler who processes the IMG tag.
2670 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2671 * destination is specified.
2672 * @param node [i] The IMG tag node is specified.
2673 * @return The conversion result is returned.
2676 s_chtml10_start_img_tag(void *pdoc, Node *node)
2682 char *attr_src = NULL;
2683 char *attr_align = NULL;
2684 char *attr_style = NULL;
2685 char *attr_alt = NULL;
2686 char *attr_width = NULL;
2687 char *attr_height = NULL;
2688 char *attr_hspace = NULL;
2689 char *attr_vspace = NULL;
2690 #ifndef IMG_NOT_CONVERT_FILENAME
2694 chtml10 = GET_CHTML10(pdoc);
2695 #ifndef IMG_NOT_CONVERT_FILENAME
2696 spec = chtml10->spec;
2701 /*--------------------------------------------------------------------------*/
2702 /* Get Attributes */
2703 /*--------------------------------------------------------------------------*/
2704 for (attr = qs_get_attr(doc,node);
2706 attr = qs_get_next_attr(doc,attr)) {
2707 char *name = qs_get_attr_name (doc,attr);
2708 char *value = qs_get_attr_value(doc,attr);
2712 if (strcasecmp(name, "src") == 0) {
2713 /*--------------------------------------------------------------------*/
2715 /*--------------------------------------------------------------------*/
2716 #ifdef IMG_NOT_CONVERT_FILENAME
2717 value = chxj_encoding_parameter(r, value, 0);
2718 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2719 value = chxj_add_cookie_no_update_parameter(r, value, 0);
2720 value = chxj_img_rewrite_parameter(r,chtml10->conf,value);
2723 value = chxj_img_conv(r, spec, value);
2724 value = chxj_encoding_parameter(r, value, 0);
2725 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2726 value = chxj_add_cookie_no_update_parameter(r, value);
2727 value = chxj_img_rewrite_parameter(r,chtml10->conf,value);
2731 else if (strcasecmp(name,"style") == 0 && value && *value) {
2738 if (strcasecmp(name, "align" ) == 0) {
2739 /*--------------------------------------------------------------------*/
2741 /*--------------------------------------------------------------------*/
2742 /*--------------------------------------------------------------------*/
2744 /*--------------------------------------------------------------------*/
2746 if (STRCASEEQ('t','T',"top", value) ||
2747 STRCASEEQ('m','M',"middle",value) ||
2748 STRCASEEQ('b','B',"bottom",value) ||
2749 STRCASEEQ('l','L',"left", value) ||
2750 STRCASEEQ('r','R',"right", value)) {
2753 else if (STRCASEEQ('c','C',"center", value)) {
2754 attr_align = apr_pstrdup(doc->pool, "middle");
2758 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2759 /*--------------------------------------------------------------------*/
2761 /*--------------------------------------------------------------------*/
2768 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2769 /*--------------------------------------------------------------------*/
2771 /*--------------------------------------------------------------------*/
2778 if (strcasecmp(name, "height") == 0 && value && *value) {
2779 /*--------------------------------------------------------------------*/
2781 /*--------------------------------------------------------------------*/
2782 attr_height = value;
2785 if (strcasecmp(name, "hspace") == 0 && value && *value) {
2786 /*--------------------------------------------------------------------*/
2788 /*--------------------------------------------------------------------*/
2789 attr_hspace = value;
2795 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2796 /*--------------------------------------------------------------------*/
2798 /*--------------------------------------------------------------------*/
2799 attr_vspace = value;
2808 if (IS_CSS_ON(chtml10->entryp)) {
2809 css_prop_list_t *style = s_chtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2811 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
2812 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
2813 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
2814 css_property_t *cur;
2815 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
2816 attr_height = apr_pstrdup(doc->pool, cur->value);
2818 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
2819 attr_width = apr_pstrdup(doc->pool, cur->value);
2821 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
2822 attr_align = apr_pstrdup(doc->pool, cur->value);
2864 return chtml10->out;
2869 * It is a handler who processes the IMG tag.
2871 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
2872 * destination is specified.
2873 * @param node [i] The IMG tag node is specified.
2874 * @return The conversion result is returned.
2877 s_chtml10_end_img_tag(void *pdoc, Node *UNUSED(child))
2879 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2880 return chtml10->out;
2885 * It is a handler who processes the SELECT tag.
2887 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2888 * destination is specified.
2889 * @param node [i] The SELECT tag node is specified.
2890 * @return The conversion result is returned.
2893 s_chtml10_start_select_tag(void *pdoc, Node *node)
2899 char *attr_style = NULL;
2904 chtml10 = GET_CHTML10(pdoc);
2912 for (attr = qs_get_attr(doc,node);
2914 attr = qs_get_next_attr(doc,attr)) {
2915 char *nm = qs_get_attr_name (doc,attr);
2916 char *val = qs_get_attr_value(doc,attr);
2920 if (strcasecmp(nm, "size") == 0) {
2921 /*--------------------------------------------------------------------*/
2922 /* CHTML 1.0 version 2.0 */
2923 /*--------------------------------------------------------------------*/
2924 size = apr_pstrdup(doc->buf.pool, val);
2926 else if (strcasecmp(nm, "style") == 0 && val && *val) {
2927 /*--------------------------------------------------------------------*/
2928 /* CHTML 1.0 version 2.0 */
2929 /*--------------------------------------------------------------------*/
2930 attr_style = apr_pstrdup(doc->buf.pool, val);
2936 if (strcasecmp(nm, "name") == 0) {
2937 /*--------------------------------------------------------------------*/
2938 /* CHTML 1.0 version 2.0 */
2939 /*--------------------------------------------------------------------*/
2940 name = apr_pstrdup(doc->buf.pool, val);
2946 if (strcasecmp(nm, "multiple") == 0) {
2947 /*--------------------------------------------------------------------*/
2948 /* CHTML 1.0 version 2.0 */
2949 /*--------------------------------------------------------------------*/
2959 if (size && *size != 0) {
2965 if (name && *name != 0) {
2972 if (IS_CSS_ON(chtml10->entryp)) {
2973 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2975 return chtml10->out;
2980 * It is a handler who processes the SELECT tag.
2982 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2983 * destination is specified.
2984 * @param node [i] The SELECT tag node is specified.
2985 * @return The conversion result is returned.
2988 s_chtml10_end_select_tag(void *pdoc, Node *UNUSED(child))
2994 chtml10 = GET_CHTML10(pdoc);
2999 if (IS_CSS_ON(chtml10->entryp)) {
3000 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3002 return chtml10->out;
3007 * It is a handler who processes the OPTION tag.
3009 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3010 * destination is specified.
3011 * @param node [i] The OPTION tag node is specified.
3012 * @return The conversion result is returned.
3015 s_chtml10_start_option_tag(void *pdoc, Node *node)
3023 char *attr_style = NULL;
3025 chtml10 = GET_CHTML10(pdoc);
3034 for (attr = qs_get_attr(doc,node);
3036 attr = qs_get_next_attr(doc,attr)) {
3037 char *nm = qs_get_attr_name (doc,attr);
3038 char *val = qs_get_attr_value(doc,attr);
3042 if (strcasecmp(nm, "selected") == 0) {
3043 /*--------------------------------------------------------------------*/
3044 /* CHTML 1.0 version 2.0 */
3045 /*--------------------------------------------------------------------*/
3046 selected = apr_pstrdup(doc->buf.pool, val);
3048 else if (strcasecmp(nm, "style") == 0 && val && *val) {
3049 /*--------------------------------------------------------------------*/
3050 /* CHTML 1.0 version 2.0 */
3051 /*--------------------------------------------------------------------*/
3052 attr_style = apr_pstrdup(doc->buf.pool, val);
3058 if (strcasecmp(nm, "value") == 0) {
3059 /*--------------------------------------------------------------------*/
3060 /* CHTML 1.0 version 2.0 */
3061 /*--------------------------------------------------------------------*/
3062 value = apr_pstrdup(doc->buf.pool, val);
3082 if (IS_CSS_ON(chtml10->entryp)) {
3083 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3085 return chtml10->out;
3090 * It is a handler who processes the OPTION tag.
3092 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3093 * destination is specified.
3094 * @param node [i] The OPTION tag node is specified.
3095 * @return The conversion result is returned.
3098 s_chtml10_end_option_tag(void *pdoc, Node *UNUSED(child))
3100 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3103 if (IS_CSS_ON(chtml10->entryp)) {
3104 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3107 return chtml10->out;
3112 * It is a handler who processes the DIV tag.
3114 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3115 * destination is specified.
3116 * @param node [i] The DIV tag node is specified.
3117 * @return The conversion result is returned.
3120 s_chtml10_start_div_tag(void *pdoc, Node *node)
3126 char *attr_align = NULL;
3127 char *attr_style = NULL;
3129 chtml10 = GET_CHTML10(pdoc);
3133 for (attr = qs_get_attr(doc,node);
3135 attr = qs_get_next_attr(doc,attr)) {
3136 char *nm = qs_get_attr_name(doc,attr);
3137 char *val = qs_get_attr_value(doc,attr);
3138 if (STRCASEEQ('a','A',"align", nm)) {
3139 /*----------------------------------------------------------------------*/
3140 /* CHTML 1.0 (W3C version 3.2) */
3141 /*----------------------------------------------------------------------*/
3142 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3143 attr_align = apr_pstrdup(doc->buf.pool, val);
3146 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3147 attr_style = apr_pstrdup(doc->pool, val);
3150 if (IS_CSS_ON(chtml10->entryp)) {
3151 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3153 css_property_t *text_align = chxj_css_get_property_value(doc, style, "text-align");
3154 css_property_t *cur;
3155 for (cur = text_align->next; cur != text_align; cur = cur->next) {
3156 if (STRCASEEQ('l','L',"left",cur->value)) {
3157 attr_align = apr_pstrdup(doc->pool, "left");
3159 else if (STRCASEEQ('c','C',"center",cur->value)) {
3160 attr_align = apr_pstrdup(doc->pool, "center");
3162 else if (STRCASEEQ('r','R',"right",cur->value)) {
3163 attr_align = apr_pstrdup(doc->pool, "right");
3177 return chtml10->out;
3182 * It is a handler who processes the DIV tag.
3184 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3185 * destination is specified.
3186 * @param node [i] The DIV tag node is specified.
3187 * @return The conversion result is returned.
3190 s_chtml10_end_div_tag(void *pdoc, Node *UNUSED(child))
3196 chtml10 = GET_CHTML10(pdoc);
3202 if (IS_CSS_ON(chtml10->entryp)) {
3203 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3206 return chtml10->out;
3211 * It is a handler who processes the CHXJ:IF tag.
3213 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3214 * destination is specified.
3215 * @param node [i] The CHXJ:IF tag node is specified.
3216 * @return The conversion result is returned.
3219 s_chtml10_chxjif_tag(void *pdoc, Node *node)
3226 chtml10 = GET_CHTML10(pdoc);
3230 for (child = qs_get_child_node(doc, node);
3232 child = qs_get_next_node(doc, child)) {
3234 s_chtml10_chxjif_tag(chtml10, child);
3237 return chtml10->out;
3242 * It is a handler who processes the PRE tag.
3244 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3245 * destination is specified.
3246 * @param node [i] The PRE tag node is specified.
3247 * @return The conversion result is returned.
3250 s_chtml10_start_pre_tag(void *pdoc, Node *node)
3256 char *attr_style = NULL;
3258 chtml10 = GET_CHTML10(pdoc);
3262 for (attr = qs_get_attr(doc,node);
3264 attr = qs_get_next_attr(doc,attr)) {
3265 char *nm = qs_get_attr_name(doc,attr);
3266 char *val = qs_get_attr_value(doc,attr);
3267 if (val && STRCASEEQ('s','S',"style", nm)) {
3272 if (IS_CSS_ON(chtml10->entryp)) {
3273 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3275 chtml10->pre_flag++;
3277 return chtml10->out;
3282 * It is a handler who processes the PRE tag.
3284 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3285 * destination is specified.
3286 * @param node [i] The PRE tag node is specified.
3287 * @return The conversion result is returned.
3290 s_chtml10_end_pre_tag(void *pdoc, Node *UNUSED(child))
3296 chtml10 = GET_CHTML10(pdoc);
3301 chtml10->pre_flag--;
3302 if (IS_CSS_ON(chtml10->entryp)) {
3303 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3306 return chtml10->out;
3311 * It is a handler who processes the P tag.
3313 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3314 * destination is specified.
3315 * @param node [i] The P tag node is specified.
3316 * @return The conversion result is returned.
3319 s_chtml10_start_p_tag(void *pdoc, Node *node)
3325 char *attr_align = NULL;
3326 char *attr_style = NULL;
3328 chtml10 = GET_CHTML10(pdoc);
3332 for (attr = qs_get_attr(doc,node);
3334 attr = qs_get_next_attr(doc,attr)) {
3335 char *nm = qs_get_attr_name(doc,attr);
3336 char *val = qs_get_attr_value(doc,attr);
3337 if (STRCASEEQ('a','A',"align", nm)) {
3338 /*----------------------------------------------------------------------*/
3339 /* CHTML 1.0 (W3C version 3.2) */
3340 /*----------------------------------------------------------------------*/
3341 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3342 attr_align = apr_pstrdup(doc->buf.pool, val);
3346 else if (val && STRCASEEQ('s','S',"style", nm)) {
3350 if (IS_CSS_ON(chtml10->entryp)) {
3351 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3353 css_property_t *text_align = chxj_css_get_property_value(doc, style, "text-align");
3354 css_property_t *cur;
3355 for (cur = text_align->next; cur != text_align; cur = cur->next) {
3356 if (STRCASEEQ('l','L',"left",cur->value)) {
3357 attr_align = apr_pstrdup(doc->pool, "left");
3359 else if (STRCASEEQ('c','C',"center",cur->value)) {
3360 attr_align = apr_pstrdup(doc->pool, "center");
3362 else if (STRCASEEQ('r','R',"right",cur->value)) {
3363 attr_align = apr_pstrdup(doc->pool, "right");
3375 return chtml10->out;
3380 * It is a handler who processes the P tag.
3382 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3383 * destination is specified.
3384 * @param node [i] The P tag node is specified.
3385 * @return The conversion result is returned.
3388 s_chtml10_end_p_tag(void *pdoc, Node *UNUSED(child))
3394 chtml10 = GET_CHTML10(pdoc);
3399 if (IS_CSS_ON(chtml10->entryp)) {
3400 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3402 return chtml10->out;
3407 * It is a handler who processes the TEXTARE tag.
3409 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3410 * destination is specified.
3411 * @param node [i] The TEXTAREA tag node is specified.
3412 * @return The conversion result is returned.
3415 s_chtml10_start_textarea_tag(void *pdoc, Node *node)
3422 chtml10 = GET_CHTML10(pdoc);
3426 chtml10->textarea_flag++;
3430 for (attr = qs_get_attr(doc,node);
3432 attr = qs_get_next_attr(doc,attr)) {
3433 char *name = qs_get_attr_name (doc,attr);
3434 char *value = qs_get_attr_value(doc,attr);
3438 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
3439 W_L(" accesskey=\"");
3447 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
3456 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3465 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3477 return chtml10->out;
3482 * It is a handler who processes the TEXTAREA tag.
3484 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3485 * destination is specified.
3486 * @param node [i] The TEXTAREA tag node is specified.
3487 * @return The conversion result is returned.
3490 s_chtml10_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3496 chtml10 = GET_CHTML10(pdoc);
3501 chtml10->textarea_flag--;
3503 return chtml10->out;
3508 s_chtml10_text(void *pdoc, Node *child)
3519 apr_size_t z2h_input_len;
3521 chtml10 = GET_CHTML10(pdoc);
3525 textval = qs_get_node_value(doc,child);
3526 if (strlen(textval) == 0) {
3527 return chtml10->out;
3530 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3531 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3533 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3534 memset(one_byte, 0, sizeof(one_byte));
3537 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3541 rtn = s_chtml10_search_emoji(chtml10, &textval[ii], &out);
3543 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3548 if (is_sjis_kanji(textval[ii])) {
3549 one_byte[0] = textval[ii+0];
3550 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3551 one_byte[0] = textval[ii+1];
3552 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3556 if (chtml10->pre_flag) {
3557 one_byte[0] = textval[ii+0];
3558 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3561 if (chtml10->textarea_flag) {
3562 one_byte[0] = textval[ii+0];
3563 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3566 if (textval[ii] != '\r' && textval[ii] != '\n') {
3567 one_byte[0] = textval[ii+0];
3568 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3572 z2h_input_len = strlen(tdst);
3573 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, chtml10->entryp);
3576 return chtml10->out;
3581 * It is a handler who processes the BLOCKQUOTE tag.
3583 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3584 * destination is specified.
3585 * @param node [i] The BLOCKQUOTE tag node is specified.
3586 * @return The conversion result is returned.
3589 s_chtml10_start_blockquote_tag(void *pdoc, Node *node)
3594 char *attr_style = NULL;
3596 chtml10 = GET_CHTML10(pdoc);
3598 for (attr = qs_get_attr(doc,node);
3600 attr = qs_get_next_attr(doc,attr)) {
3601 char *nm = qs_get_attr_name(doc,attr);
3602 char *val = qs_get_attr_value(doc,attr);
3603 if (val && STRCASEEQ('s','S',"style", nm)) {
3607 W_L("<blockquote>");
3608 if (IS_CSS_ON(chtml10->entryp)) {
3609 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3611 return chtml10->out;
3616 * It is a handler who processes the BLOCKQUOTE tag.
3618 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3619 * destination is specified.
3620 * @param node [i] The BLOCKQUOTE tag node is specified.
3621 * @return The conversion result is returned.
3624 s_chtml10_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3629 chtml10 = GET_CHTML10(pdoc);
3631 W_L("</blockquote>");
3632 if (IS_CSS_ON(chtml10->entryp)) {
3633 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3635 return chtml10->out;
3640 * It is a handler who processes the DIR tag.
3642 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3643 * destination is specified.
3644 * @param node [i] The DIR tag node is specified.
3645 * @return The conversion result is returned.
3648 s_chtml10_start_dir_tag(void *pdoc, Node *node)
3653 char *attr_style = NULL;
3655 chtml10 = GET_CHTML10(pdoc);
3658 for (attr = qs_get_attr(doc,node);
3660 attr = qs_get_next_attr(doc,attr)) {
3661 char *nm = qs_get_attr_name(doc,attr);
3662 char *val = qs_get_attr_value(doc,attr);
3663 if (val && STRCASEEQ('s','S',"style", nm)) {
3669 if (IS_CSS_ON(chtml10->entryp)) {
3670 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3672 return chtml10->out;
3677 * It is a handler who processes the DIR tag.
3679 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3680 * destination is specified.
3681 * @param node [i] The DIR tag node is specified.
3682 * @return The conversion result is returned.
3685 s_chtml10_end_dir_tag(void *pdoc, Node *UNUSED(child))
3690 chtml10 = GET_CHTML10(pdoc);
3694 if (IS_CSS_ON(chtml10->entryp)) {
3695 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3697 return chtml10->out;
3702 * It is a handler who processes the DL tag.
3704 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3705 * destination is specified.
3706 * @param node [i] The DL tag node is specified.
3707 * @return The conversion result is returned.
3710 s_chtml10_start_dl_tag(void *pdoc, Node *node)
3715 char *attr_style = NULL;
3717 chtml10 = GET_CHTML10(pdoc);
3720 for (attr = qs_get_attr(doc,node);
3722 attr = qs_get_next_attr(doc,attr)) {
3723 char *nm = qs_get_attr_name(doc,attr);
3724 char *val = qs_get_attr_value(doc,attr);
3725 if (val && STRCASEEQ('s','S',"style", nm)) {
3729 if (IS_CSS_ON(chtml10->entryp)) {
3730 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3733 return chtml10->out;
3738 * It is a handler who processes the DL tag.
3740 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3741 * destination is specified.
3742 * @param node [i] The DL tag node is specified.
3743 * @return The conversion result is returned.
3746 s_chtml10_end_dl_tag(void *pdoc, Node *UNUSED(child))
3750 chtml10 = GET_CHTML10(pdoc);
3753 if (IS_CSS_ON(chtml10->entryp)) {
3754 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3756 return chtml10->out;
3761 * It is a handter who processes the DT tag.
3763 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3764 * destination is specified.
3765 * @param node [i] The DT tag node is specified.
3766 * @return The conversion result is returned.
3769 s_chtml10_start_dt_tag(void *pdoc, Node *node)
3774 char *attr_style = NULL;
3776 chtml10 = GET_CHTML10(pdoc);
3779 for (attr = qs_get_attr(doc,node);
3781 attr = qs_get_next_attr(doc,attr)) {
3782 char *nm = qs_get_attr_name(doc,attr);
3783 char *val = qs_get_attr_value(doc,attr);
3784 if (val && STRCASEEQ('s','S',"style", nm)) {
3789 if (IS_CSS_ON(chtml10->entryp)) {
3790 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3792 return chtml10->out;
3797 * It is a handter who processes the DT tag.
3799 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3800 * destination is specified.
3801 * @param node [i] The DT tag node is specified.
3802 * @return The conversion result is returned.
3805 s_chtml10_end_dt_tag(void *pdoc, Node *UNUSED(child))
3807 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3808 if (IS_CSS_ON(chtml10->entryp)) {
3809 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3811 return chtml10->out;
3816 * It is a handder who processes the DD tag.
3818 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3819 * destination is specified.
3820 * @param node [i] The DD tag node is specified.
3821 * @return The conversion result is returned.
3824 s_chtml10_start_dd_tag(void *pdoc, Node *node)
3826 CHTML10_PUSH_ONLY("<dd>");
3831 * It is a handder who processes the DD tag.
3833 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3834 * destination is specified.
3835 * @param node [i] The DD tag node is specified.
3836 * @return The conversion result is returned.
3839 s_chtml10_end_dd_tag(void *pdoc, Node *UNUSED(child))
3841 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3842 if (IS_CSS_ON(chtml10->entryp)) {
3843 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3845 return chtml10->out;
3850 * It is a hanmenuer who processes the MENU tag.
3852 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3853 * destination is specified.
3854 * @param node [i] The MENU tag node is specified.
3855 * @return The conversion result is returned.
3858 s_chtml10_start_menu_tag(void *pdoc, Node *node)
3860 CHTML10_PUSH_ONLY("<menu>");
3865 * It is a hanmenuer who processes the MENU tag.
3867 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3868 * destination is specified.
3869 * @param node [i] The MENU tag node is specified.
3870 * @return The conversion result is returned.
3873 s_chtml10_end_menu_tag(void *pdoc, Node *UNUSED(child))
3875 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3876 Doc *doc = chtml10->doc;
3878 if (IS_CSS_ON(chtml10->entryp)) {
3879 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3881 return chtml10->out;
3886 * It is a handler who processes the PLAINTEXT tag.
3888 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3889 * destination is specified.
3890 * @param node [i] The PLAINTEXT tag node is specified.
3891 * @return The conversion result is returned.
3894 s_chtml10_start_plaintext_tag(void *pdoc, Node *node)
3899 chtml10 = GET_CHTML10(pdoc);
3902 s_chtml10_start_plaintext_tag_inner(pdoc,node);
3903 return chtml10->out;
3907 s_chtml10_start_plaintext_tag_inner(void *pdoc, Node *node)
3912 chtml10 = GET_CHTML10(pdoc);
3914 for (child = qs_get_child_node(doc, node);
3916 child = qs_get_next_node(doc, child)) {
3918 s_chtml10_start_plaintext_tag_inner(pdoc, child);
3920 return chtml10->out;
3925 * It is a handler who processes the PLAINTEXT tag.
3927 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3928 * destination is specified.
3929 * @param node [i] The PLAINTEXT tag node is specified.
3930 * @return The conversion result is returned.
3933 s_chtml10_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3935 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3936 return chtml10->out;
3941 * It is a handler who processes the LINK tag.
3943 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3944 * destination is specified.
3945 * @param node [i] The LINK tag node is specified.
3946 * @return The conversion result is returned.
3949 s_chtml10_link_tag(void *pdoc, Node *node)
3958 chtml10 = GET_CHTML10(pdoc);
3961 if (! IS_CSS_ON(chtml10->entryp)) {
3962 return chtml10->out;
3965 for (attr = qs_get_attr(doc,node);
3967 attr = qs_get_next_attr(doc,attr)) {
3968 char *name = qs_get_attr_name(doc,attr);
3969 char *value = qs_get_attr_value(doc,attr);
3970 if (STRCASEEQ('r','R',"rel", name)) {
3971 if (value && *value && STRCASEEQ('s','S',"stylesheet", value)) {
3975 else if (STRCASEEQ('h','H',"href", name)) {
3976 if (value && *value) {
3980 else if (STRCASEEQ('t','T',"type", name)) {
3981 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
3987 if (rel && href && type) {
3988 DBG(doc->r, "REQ[%X] start load CSS. url:[%s]", TO_ADDR(doc->r),href);
3989 chtml10->style = chxj_css_parse_from_uri(doc->r, doc->pool, chtml10->style, href);
3990 DBG(doc->r, "REQ[%X] end load CSS. url:[%s]", TO_ADDR(doc->r), href);
3993 return chtml10->out;
3997 * It is a handler who processes the STYLE tag.
3999 * @param pdoc [i/o] The pointer to the CHTML structure at the output
4000 * destination is specified.
4001 * @param node [i] The STYLE tag node is specified.
4002 * @return The conversion result is returned.
4005 s_chtml10_style_tag(void *pdoc, Node *node)
4012 chtml10 = GET_CHTML10(pdoc);
4015 if (! IS_CSS_ON(chtml10->entryp)) {
4016 return chtml10->out;
4019 for (attr = qs_get_attr(doc,node);
4021 attr = qs_get_next_attr(doc,attr)) {
4022 char *name = qs_get_attr_name(doc,attr);
4023 char *value = qs_get_attr_value(doc,attr);
4024 if (STRCASEEQ('t','T',"type", name)) {
4025 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
4031 Node *child = qs_get_child_node(doc, node);
4032 if (type && child) {
4033 char *name = qs_get_node_name(doc, child);
4034 if (STRCASEEQ('t','T',"text", name)) {
4035 char *value = qs_get_node_value(doc, child);
4036 DBG(doc->r, "REQ[%X] start load CSS. buf:[%s]", TO_ADDR(doc->r),value);
4037 chtml10->style = chxj_css_parse_style_value(doc, chtml10->style, value);
4038 DBG(doc->r, "REQ[%X] end load CSS. value:[%s]", TO_ADDR(doc->r),value);
4041 return chtml10->out;
4046 s_chtml10_newline_mark(void *pdoc, Node *UNUSED(node))
4048 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4049 Doc *doc = chtml10->doc;
4051 return chtml10->out;
4054 static css_prop_list_t *
4055 s_chtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
4057 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4058 Doc *doc = chtml10->doc;
4059 css_prop_list_t *last_css = NULL;
4060 if (IS_CSS_ON(chtml10->entryp)) {
4061 css_prop_list_t *dup_css;
4062 css_selector_t *selector;
4064 last_css = chxj_css_get_last_prop_list(chtml10->css_prop_stack);
4065 dup_css = chxj_dup_css_prop_list(doc, last_css);
4066 selector = chxj_css_find_selector(doc, chtml10->style, node);
4068 chxj_css_prop_list_merge_property(doc, dup_css, selector);
4070 chxj_css_push_prop_list(chtml10->css_prop_stack, dup_css);
4071 last_css = chxj_css_get_last_prop_list(chtml10->css_prop_stack);
4073 if (style_attr_value) {
4074 css_stylesheet_t *ssheet = chxj_css_parse_style_attr(doc, NULL, apr_pstrdup(doc->pool, node->name), NULL, NULL, apr_pstrdup(doc->pool, style_attr_value));
4076 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
4084 static css_prop_list_t *
4085 s_chtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
4087 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4088 Doc *doc = chtml10->doc;
4089 css_prop_list_t *last_css = NULL;
4090 if (IS_CSS_ON(chtml10->entryp)) {
4091 css_prop_list_t *dup_css;
4092 css_selector_t *selector;
4094 last_css = chxj_css_get_last_prop_list(chtml10->css_prop_stack);
4095 dup_css = chxj_dup_css_prop_list(doc, last_css);
4096 selector = chxj_css_find_selector(doc, chtml10->style, node);
4098 chxj_css_prop_list_merge_property(doc, dup_css, selector);
4102 if (style_attr_value) {
4103 css_stylesheet_t *ssheet = chxj_css_parse_style_attr(doc, NULL, apr_pstrdup(doc->pool, node->name), NULL, NULL, apr_pstrdup(doc->pool, style_attr_value));
4105 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
4115 * It is a handler who processes the SPAN tag.
4117 * @param pdoc [i/o] The pointer to the CHTML structure at the output
4118 * destination is specified.
4119 * @param node [i] The SPAN tag node is specified.
4120 * @return The conversion result is returned.
4123 s_chtml10_start_span_tag(void *pdoc, Node *node)
4128 char *attr_style = NULL;
4129 char *attr_color = NULL;
4130 char *attr_align = NULL;
4132 chtml10 = GET_CHTML10(pdoc);
4135 for (attr = qs_get_attr(doc,node);
4137 attr = qs_get_next_attr(doc,attr)) {
4138 char *nm = qs_get_attr_name(doc,attr);
4139 char *val = qs_get_attr_value(doc,attr);
4140 if (val && STRCASEEQ('s','S',"style", nm)) {
4144 if (IS_CSS_ON(chtml10->entryp)) {
4145 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
4147 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4148 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
4149 css_property_t *cur;
4150 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4151 attr_color = apr_pstrdup(doc->pool, cur->value);
4153 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
4154 if (STRCASEEQ('l','L',"left", cur->value)) {
4155 attr_align = apr_pstrdup(doc->pool, "left");
4157 else if (STRCASEEQ('c','C',"center",cur->value)) {
4158 attr_align = apr_pstrdup(doc->pool, "center");
4160 else if (STRCASEEQ('r','R',"right",cur->value)) {
4161 attr_align = apr_pstrdup(doc->pool, "right");
4166 if (attr_color || attr_align) {
4167 chtml10_flags_t *flg = apr_palloc(doc->pool, sizeof(*flg));
4168 memset(flg, 0, sizeof(*flg));
4170 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4171 W_L("<font color=\"");
4174 flg->with_font_flag = 1;
4177 W_L("<div align=\"");
4180 flg->with_div_flag = 1;
4182 node->userData = flg;
4185 node->userData = NULL;
4187 return chtml10->out;
4192 * It is a handler who processes the SPAN tag.
4194 * @param pdoc [i/o] The pointer to the CHTML structure at the output
4195 * destination is specified.
4196 * @param node [i] The SPAN tag node is specified.
4197 * @return The conversion result is returned.
4200 s_chtml10_end_span_tag(void *pdoc, Node *node)
4202 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4203 Doc *doc = chtml10->doc;
4205 chtml10_flags_t *flg = (chtml10_flags_t *)node->userData;
4206 if (flg && flg->with_div_flag) {
4209 if (flg && flg->with_font_flag) {
4212 if (IS_CSS_ON(chtml10->entryp)) {
4213 chxj_css_pop_prop_list(chtml10->css_prop_stack);
4215 return chtml10->out;