2 * Copyright (C) 2005-2009 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"
29 #define GET_CHTML10(X) ((chtml10_t *)(X))
32 #define W_L(X) do { chtml10->out = BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, (X)); } while(0)
33 #define W_V(X) do { chtml10->out = (X) ? BUFFERED_WRITE_VALUE(chtml10->out, &doc->buf, (X)) \
34 : BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, ""); } while(0)
37 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml10->conf); W_V(nlcode); } while (0)
39 #define CHTML10_PUSH_ONLY(tagname) \
44 char *attr_style = NULL; \
45 chtml10 = GET_CHTML10(pdoc); \
47 for (attr = qs_get_attr(doc,node); \
49 attr = qs_get_next_attr(doc,attr)) { \
50 char *nm = qs_get_attr_name(doc,attr); \
51 char *val = qs_get_attr_value(doc,attr); \
52 if (val && STRCASEEQ('s','S',"style", nm)) { \
57 if (IS_CSS_ON(chtml10->entryp)) { \
58 s_chtml10_push_and_get_now_style(pdoc, node, attr_style); \
60 return chtml10->out; \
64 static char *s_chtml10_start_html_tag (void *pdoc, Node *node);
65 static char *s_chtml10_end_html_tag (void *pdoc, Node *node);
66 static char *s_chtml10_start_meta_tag (void *pdoc, Node *node);
67 static char *s_chtml10_end_meta_tag (void *pdoc, Node *node);
68 static char *s_chtml10_start_textarea_tag (void *pdoc, Node *node);
69 static char *s_chtml10_end_textarea_tag (void *pdoc, Node *node);
70 static char *s_chtml10_start_p_tag (void *pdoc, Node *node);
71 static char *s_chtml10_end_p_tag (void *pdoc, Node *node);
72 static char *s_chtml10_start_pre_tag (void *pdoc, Node *node);
73 static char *s_chtml10_end_pre_tag (void *pdoc, Node *node);
74 static char *s_chtml10_start_ul_tag (void *pdoc, Node *node);
75 static char *s_chtml10_end_ul_tag (void *pdoc, Node *node);
76 static char *s_chtml10_start_li_tag (void *pdoc, Node *node);
77 static char *s_chtml10_end_li_tag (void *pdoc, Node *node);
78 static char *s_chtml10_start_ol_tag (void *pdoc, Node *node);
79 static char *s_chtml10_end_ol_tag (void *pdoc, Node *node);
80 static char *s_chtml10_start_h1_tag (void *pdoc, Node *node);
81 static char *s_chtml10_end_h1_tag (void *pdoc, Node *node);
82 static char *s_chtml10_start_h2_tag (void *pdoc, Node *node);
83 static char *s_chtml10_end_h2_tag (void *pdoc, Node *node);
84 static char *s_chtml10_start_h3_tag (void *pdoc, Node *node);
85 static char *s_chtml10_end_h3_tag (void *pdoc, Node *node);
86 static char *s_chtml10_start_h4_tag (void *pdoc, Node *node);
87 static char *s_chtml10_end_h4_tag (void *pdoc, Node *node);
88 static char *s_chtml10_start_h5_tag (void *pdoc, Node *node);
89 static char *s_chtml10_end_h5_tag (void *pdoc, Node *node);
90 static char *s_chtml10_start_h6_tag (void *pdoc, Node *node);
91 static char *s_chtml10_end_h6_tag (void *pdoc, Node *node);
92 static char *s_chtml10_start_head_tag (void *pdoc, Node *node);
93 static char *s_chtml10_end_head_tag (void *pdoc, Node *node);
94 static char *s_chtml10_start_title_tag (void *pdoc, Node *node);
95 static char *s_chtml10_end_title_tag (void *pdoc, Node *node);
96 static char *s_chtml10_start_base_tag (void *pdoc, Node *node);
97 static char *s_chtml10_end_base_tag (void *pdoc, Node *node);
98 static char *s_chtml10_start_body_tag (void *pdoc, Node *node);
99 static char *s_chtml10_end_body_tag (void *pdoc, Node *node);
100 static char *s_chtml10_start_a_tag (void *pdoc, Node *node);
101 static char *s_chtml10_end_a_tag (void *pdoc, Node *node);
102 static char *s_chtml10_start_br_tag (void *pdoc, Node *node);
103 static char *s_chtml10_end_br_tag (void *pdoc, Node *node);
104 static char *s_chtml10_start_tr_tag (void *pdoc, Node *node);
105 static char *s_chtml10_end_tr_tag (void *pdoc, Node *node);
106 static char *s_chtml10_start_input_tag (void *pdoc, Node *node);
107 static char *s_chtml10_end_input_tag (void *pdoc, Node *node);
108 static char *s_chtml10_start_form_tag (void *pdoc, Node *node);
109 static char *s_chtml10_end_form_tag (void *pdoc, Node *node);
110 static char *s_chtml10_start_center_tag (void *pdoc, Node *node);
111 static char *s_chtml10_end_center_tag (void *pdoc, Node *node);
112 static char *s_chtml10_start_hr_tag (void *pdoc, Node *node);
113 static char *s_chtml10_end_hr_tag (void *pdoc, Node *node);
114 static char *s_chtml10_start_img_tag (void *pdoc, Node *node);
115 static char *s_chtml10_end_img_tag (void *pdoc, Node *node);
116 static char *s_chtml10_start_select_tag (void *pdoc, Node *node);
117 static char *s_chtml10_end_select_tag (void *pdoc, Node *node);
118 static char *s_chtml10_start_option_tag (void *pdoc, Node *node);
119 static char *s_chtml10_end_option_tag (void *pdoc, Node *node);
120 static char *s_chtml10_start_div_tag (void *pdoc, Node *node);
121 static char *s_chtml10_end_div_tag (void *pdoc, Node *node);
122 static char *s_chtml10_start_blockquote_tag (void *pdoc, Node *node);
123 static char *s_chtml10_end_blockquote_tag (void *pdoc, Node *node);
124 static char *s_chtml10_start_dir_tag (void *pdoc, Node *node);
125 static char *s_chtml10_end_dir_tag (void *pdoc, Node *node);
126 static char *s_chtml10_start_dl_tag (void *pdoc, Node *node);
127 static char *s_chtml10_end_dl_tag (void *pdoc, Node *node);
128 static char *s_chtml10_start_dt_tag (void *pdoc, Node *node);
129 static char *s_chtml10_end_dt_tag (void *pdoc, Node *node);
130 static char *s_chtml10_start_dd_tag (void *pdoc, Node *node);
131 static char *s_chtml10_end_dd_tag (void *pdoc, Node *node);
132 static char *s_chtml10_start_menu_tag (void *pdoc, Node *node);
133 static char *s_chtml10_end_menu_tag (void *pdoc, Node *node);
134 static char *s_chtml10_start_plaintext_tag (void *pdoc, Node *node);
135 static char *s_chtml10_start_plaintext_tag_inner(void *pdoc, Node *node);
136 static char *s_chtml10_end_plaintext_tag (void *pdoc, Node *node);
137 static char *s_chtml10_link_tag (void *pdoc, Node *node);
138 static char *s_chtml10_style_tag (void *pdoc, Node *node);
139 static char *s_chtml10_newline_mark (void *pdoc, Node *node);
140 static char *s_chtml10_start_span_tag (void *pdoc, Node *node);
141 static char *s_chtml10_end_span_tag (void *pdoc, Node *node);
143 static void s_init_chtml10(chtml10_t *chtml, Doc *doc, request_rec *r, device_table *spec);
145 static int s_chtml10_search_emoji(chtml10_t *chtml, char *txt, char **rslt);
146 static char *s_chtml10_chxjif_tag (void *pdoc, Node *node);
147 static char *s_chtml10_text (void *pdoc, Node *node);
148 static css_prop_list_t *s_chtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
149 static css_prop_list_t *s_chtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
153 tag_handler chtml10_handler[] = {
156 s_chtml10_start_html_tag,
157 s_chtml10_end_html_tag,
161 s_chtml10_start_meta_tag,
162 s_chtml10_end_meta_tag,
166 s_chtml10_start_textarea_tag,
167 s_chtml10_end_textarea_tag,
171 s_chtml10_start_p_tag,
176 s_chtml10_start_pre_tag,
177 s_chtml10_end_pre_tag,
181 s_chtml10_start_ul_tag,
182 s_chtml10_end_ul_tag,
186 s_chtml10_start_li_tag,
187 s_chtml10_end_li_tag,
191 s_chtml10_start_ol_tag,
192 s_chtml10_end_ol_tag,
196 s_chtml10_start_h1_tag,
197 s_chtml10_end_h1_tag,
201 s_chtml10_start_h2_tag,
202 s_chtml10_end_h2_tag,
206 s_chtml10_start_h3_tag,
207 s_chtml10_end_h3_tag,
211 s_chtml10_start_h4_tag,
212 s_chtml10_end_h4_tag,
216 s_chtml10_start_h5_tag,
217 s_chtml10_end_h5_tag,
221 s_chtml10_start_h6_tag,
222 s_chtml10_end_h6_tag,
226 s_chtml10_start_head_tag,
227 s_chtml10_end_head_tag,
231 s_chtml10_start_title_tag,
232 s_chtml10_end_title_tag,
236 s_chtml10_start_base_tag,
237 s_chtml10_end_base_tag,
241 s_chtml10_start_body_tag,
242 s_chtml10_end_body_tag,
246 s_chtml10_start_a_tag,
251 s_chtml10_start_br_tag,
252 s_chtml10_end_br_tag,
261 s_chtml10_start_tr_tag,
262 s_chtml10_end_tr_tag,
281 s_chtml10_start_form_tag,
282 s_chtml10_end_form_tag,
286 s_chtml10_start_input_tag,
287 s_chtml10_end_input_tag,
291 s_chtml10_start_center_tag,
292 s_chtml10_end_center_tag,
296 s_chtml10_start_hr_tag,
297 s_chtml10_end_hr_tag,
301 s_chtml10_start_img_tag,
302 s_chtml10_end_img_tag,
306 s_chtml10_start_select_tag,
307 s_chtml10_end_select_tag,
311 s_chtml10_start_option_tag,
312 s_chtml10_end_option_tag,
316 s_chtml10_start_div_tag,
317 s_chtml10_end_div_tag,
321 s_chtml10_chxjif_tag,
326 s_chtml10_chxjif_tag,
346 s_chtml10_start_span_tag,
347 s_chtml10_end_span_tag,
371 s_chtml10_start_dt_tag,
372 s_chtml10_end_dt_tag,
386 s_chtml10_start_blockquote_tag,
387 s_chtml10_end_blockquote_tag,
391 s_chtml10_start_dir_tag,
392 s_chtml10_end_dir_tag,
396 s_chtml10_start_dl_tag,
397 s_chtml10_end_dl_tag,
401 s_chtml10_start_dd_tag,
402 s_chtml10_end_dd_tag,
406 s_chtml10_start_menu_tag,
407 s_chtml10_end_menu_tag,
411 s_chtml10_start_plaintext_tag,
412 s_chtml10_end_plaintext_tag,
431 s_chtml10_newline_mark,
448 * converts from CHTML5.0 to CHTML1.0.
450 * @param r [i] Requet_rec is appointed.
451 * @param spec [i] The result of the device specification processing which
452 * was done in advance is appointed.
453 * @param src [i] The character string before the converting is appointed.
454 * @return The character string after the converting is returned.
457 chxj_convert_chtml10(
463 chxjconvrule_entry *entryp,
476 DBG(r, "start chxj_convert_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
478 /*--------------------------------------------------------------------------*/
480 /*--------------------------------------------------------------------------*/
482 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
484 DBG(r,"i found qrcode xml");
487 DBG(r,"not found qrcode xml");
489 /*--------------------------------------------------------------------------*/
490 /* The CHTML structure is initialized. */
491 /*--------------------------------------------------------------------------*/
492 s_init_chtml10(&chtml10, &doc, r, spec);
493 chtml10.entryp = entryp;
494 chtml10.cookie = cookie;
496 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
498 /*--------------------------------------------------------------------------*/
499 /* The character string of the input is analyzed. */
500 /*--------------------------------------------------------------------------*/
501 qs_init_malloc(&doc);
502 qs_init_root_node(&doc);
504 if (IS_CSS_ON(chtml10.entryp)) {
505 /* current property list */
506 chtml10.css_prop_stack = chxj_new_prop_list_stack(&doc);
509 ss = apr_pcalloc(r->pool, srclen + 1);
510 memset(ss, 0, srclen + 1);
511 memcpy(ss, src, srclen);
514 chxj_dump_out("[src] CHTML -> CHTML1.0", ss, srclen);
517 qs_parse_string(&doc,ss, strlen(ss));
519 chxj_buffered_write_init(r->pool, &doc.buf);
520 /*--------------------------------------------------------------------------*/
521 /* It converts it from CHTML to CHTML. */
522 /*--------------------------------------------------------------------------*/
523 chxj_node_convert(spec,r,(void *)&chtml10, &doc, qs_get_root(&doc), 0);
524 chtml10.out = chxj_buffered_write_flush(chtml10.out, &doc.buf);
525 dst = apr_pstrdup(r->pool, chtml10.out);
526 chxj_buffered_write_terminate(&doc.buf);
528 qs_all_free(&doc,QX_LOGMARK);
531 return apr_pstrdup(r->pool,ss);
534 if (strlen(dst) == 0) {
535 dst = apr_psprintf(r->pool, "\n");
537 *dstlen = strlen(dst);
540 chxj_dump_out("[dst] CHTML -> CHTML1.0", dst, *dstlen);
543 DBG(r, "end chxj_convert_chtml10() cookie_id=[%s] time=[%" APR_TIME_T_FMT "]", (cookie) ? cookie->cookie_id : "", apr_time_now() - t);
550 * The CHTML structure is initialized.
552 * @param chtml10 [i/o] The pointer to the HDML structure that wants to be
553 * initialized is specified.
554 * @param doc [i] The Doc structure that should be set to the initialized
555 * HDML structure is specified.
556 * @param r [i] To use POOL, the pointer to request_rec is specified.
557 * @param spec [i] The pointer to the device_table
566 memset(doc, 0, sizeof(Doc));
567 memset(chtml10, 0, sizeof(chtml10_t));
571 chtml10->spec = spec;
572 chtml10->out = qs_alloc_zero_byte_string(r->pool);
573 chtml10->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
574 chtml10->doc->parse_mode = PARSE_MODE_CHTML;
575 chtml10->style = NULL;
580 * Corresponding EMOJI to a current character-code is retrieved.
581 * The substitution character string is stored in the rslt pointer if agreeing.
583 * @param chtml10 [i] The pointer to the CHTML structure is specified.
584 * @param txt [i] The character string to want to examine whether it is
585 * EMOJI is specified.
586 * @param rslt [o] The pointer to the pointer that stores the result is
588 * @return When corresponding EMOJI exists, it returns it excluding 0.
591 s_chtml10_search_emoji(chtml10_t *chtml10, char *txt, char **rslt)
598 spec = chtml10->spec;
604 DBG(r,"spec is NULL");
607 for (ee = chtml10->conf->emoji;
612 DBG(r,"emoji->imode is NULL");
616 if (ee->imode->string
618 && strlen(ee->imode->string) > 0
619 && *ee->imode->string == *txt
620 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
621 *rslt = apr_palloc(r->pool, 3);
622 (*rslt)[0] = ee->imode->hex1byte & 0xff;
623 (*rslt)[1] = ee->imode->hex2byte & 0xff;
625 return strlen(ee->imode->string);
632 chxj_chtml10_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
643 chtml10 = &__chtml10;
646 DBG(r, "REQ[%X] start chxj_chtml10_emoji_only_converter()", (unsigned int)(apr_size_t)r);
647 memset(doc, 0, sizeof(Doc));
648 memset(chtml10, 0, sizeof(chtml10_t));
652 chtml10->spec = spec;
653 chtml10->out = qs_alloc_zero_byte_string(r->pool);
654 chtml10->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
655 chtml10->doc->parse_mode = PARSE_MODE_CHTML;
657 apr_pool_create(&pool, r->pool);
659 chxj_buffered_write_init(pool, &doc->buf);
661 for (ii=0; ii<len; ii++) {
665 rtn = s_chtml10_search_emoji(chtml10, (char *)&src[ii], &out);
672 if (is_sjis_kanji(src[ii])) {
673 two_byte[0] = src[ii+0];
674 two_byte[1] = src[ii+1];
680 one_byte[0] = src[ii+0];
686 chtml10->out = chxj_buffered_write_flush(chtml10->out, &doc->buf);
688 DBG(r, "REQ[%X] end chxj_chtml10_emoji_only_converter()", (unsigned int)(apr_size_t)r);
694 * It is a handler who processes the HTML tag.
696 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
697 * destination is specified.
698 * @param node [i] The HTML tag node is specified.
699 * @return The conversion result is returned.
702 s_chtml10_start_html_tag(void *pdoc, Node *UNUSED(node))
708 chtml10 = GET_CHTML10(pdoc);
712 /*--------------------------------------------------------------------------*/
714 /*--------------------------------------------------------------------------*/
721 * It is a handler who processes the HTML tag.
723 * @param pdoc [i/o] The pointer to the CHTML structure at the output
724 * destination is specified.
725 * @param node [i] The HTML tag node is specified.
726 * @return The conversion result is returned.
729 s_chtml10_end_html_tag(void *pdoc, Node *UNUSED(child))
736 chtml10 = GET_CHTML10(pdoc);
740 if (IS_CSS_ON(chtml10->entryp)) {
741 chxj_css_pop_prop_list(chtml10->css_prop_stack);
750 * It is a handler who processes the META tag.
752 * @param pdoc [i/o] The pointer to the CHTML structure at the output
753 * destination is specified.
754 * @param node [i] The META tag node is specified.
755 * @return The conversion result is returned.
758 s_chtml10_start_meta_tag(void *pdoc, Node *UNUSED(node))
760 chtml10_t *chtml10 = GET_CHTML10(pdoc);
769 * It is a handler who processes the META tag.
771 * @param pdoc [i/o] The pointer to the CHTML structure at the output
772 * destination is specified.
773 * @param node [i] The META tag node is specified.
774 * @return The conversion result is returned.
777 s_chtml10_end_meta_tag(void *pdoc, Node *UNUSED(child))
779 chtml10_t *chtml10 = GET_CHTML10(pdoc);
786 * It is a handler who processes the HEAD tag.
788 * @param pdoc [i/o] The pointer to the CHTML structure at the output
789 * destination is specified.
790 * @param node [i] The HEAD tag node is specified.
791 * @return The conversion result is returned.
794 s_chtml10_start_head_tag(void *pdoc, Node *UNUSED(node))
800 chtml10 = GET_CHTML10(pdoc);
811 * It is a handler who processes the HEAD tag.
813 * @param pdoc [i/o] The pointer to the CHTML structure at the output
814 * destination is specified.
815 * @param node [i] The HEAD tag node is specified.
816 * @return The conversion result is returned.
819 s_chtml10_end_head_tag(void *pdoc, Node *UNUSED(child))
825 chtml10 = GET_CHTML10(pdoc);
836 * It is a handler who processes the OL tag.
838 * @param pdoc [i/o] The pointer to the CHTML structure at the output
839 * destination is specified.
840 * @param node [i] The OL tag node is specified.
841 * @return The conversion result is returned.
844 s_chtml10_start_ol_tag(void *pdoc, Node *node)
850 char *attr_style = NULL;
852 chtml10 = GET_CHTML10(pdoc);
856 for (attr = qs_get_attr(doc,node);
858 attr = qs_get_next_attr(doc,attr)) {
859 char *nm = qs_get_attr_name(doc,attr);
860 char *val = qs_get_attr_value(doc,attr);
861 if (val && STRCASEEQ('s','S',"style", nm)) {
866 if (IS_CSS_ON(chtml10->entryp)) {
867 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
877 * It is a handler who processes the OL tag.
879 * @param pdoc [i/o] The pointer to the CHTML structure at the output
880 * destination is specified.
881 * @param node [i] The OL tag node is specified.
882 * @return The conversion result is returned.
885 s_chtml10_end_ol_tag(void *pdoc, Node *UNUSED(child))
891 chtml10 = GET_CHTML10(pdoc);
896 if (IS_CSS_ON(chtml10->entryp)) {
897 chxj_css_pop_prop_list(chtml10->css_prop_stack);
905 * It is a handler who processes the UL tag.
907 * @param pdoc [i/o] The pointer to the CHTML structure at the output
908 * destination is specified.
909 * @param node [i] The UL tag node is specified.
910 * @return The conversion result is returned.
913 s_chtml10_start_ul_tag(void *pdoc, Node *node)
919 char *attr_style = NULL;
921 chtml10 = GET_CHTML10(pdoc);
926 for (attr = qs_get_attr(doc,node);
928 attr = qs_get_next_attr(doc,attr)) {
929 char *nm = qs_get_attr_name(doc,attr);
930 char *val = qs_get_attr_value(doc,attr);
931 if (val && STRCASEEQ('s','S',"style", nm)) {
936 if (IS_CSS_ON(chtml10->entryp)) {
937 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
947 * It is a handler who processes the UL tag.
949 * @param pdoc [i/o] The pointer to the CHTML structure at the output
950 * destination is specified.
951 * @param node [i] The UL tag node is specified.
952 * @return The conversion result is returned.
955 s_chtml10_end_ul_tag(void *pdoc, Node *UNUSED(child))
961 chtml10 = GET_CHTML10(pdoc);
966 if (IS_CSS_ON(chtml10->entryp)) {
967 chxj_css_pop_prop_list(chtml10->css_prop_stack);
975 * It is a handler who processes the LI tag.
977 * @param pdoc [i/o] The pointer to the CHTML structure at the output
978 * destination is specified.
979 * @param node [i] The LI tag node is specified.
980 * @return The conversion result is returned.
983 s_chtml10_start_li_tag(void *pdoc, Node *node)
989 char *attr_style = NULL;
991 chtml10 = GET_CHTML10(pdoc);
995 for (attr = qs_get_attr(doc,node);
997 attr = qs_get_next_attr(doc,attr)) {
998 char *nm = qs_get_attr_name(doc,attr);
999 char *val = qs_get_attr_value(doc,attr);
1000 if (val && STRCASEEQ('s','S',"style", nm)) {
1005 if (IS_CSS_ON(chtml10->entryp)) {
1006 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1010 return chtml10->out;
1015 * It is a handler who processes the LI tag.
1017 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1018 * destination is specified.
1019 * @param node [i] The LI tag node is specified.
1020 * @return The conversion result is returned.
1023 s_chtml10_end_li_tag(void *pdoc, Node *UNUSED(child))
1025 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1026 if (IS_CSS_ON(chtml10->entryp)) {
1027 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1029 return chtml10->out;
1034 * It is a handler who processes the H1 tag.
1036 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1037 * destination is specified.
1038 * @param node [i] The H1 tag node is specified.
1039 * @return The conversion result is returned.
1042 s_chtml10_start_h1_tag(void *pdoc, Node *node)
1048 char *attr_style = NULL;
1049 char *attr_align = NULL;
1051 chtml10 = GET_CHTML10(pdoc);
1055 for (attr = qs_get_attr(doc,node);
1057 attr = qs_get_next_attr(doc,attr)) {
1058 char *name = qs_get_attr_name(doc,attr);
1059 char *value = qs_get_attr_value(doc,attr);
1060 if (STRCASEEQ('a','A',"align", name)) {
1061 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1065 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1069 if (IS_CSS_ON(chtml10->entryp)) {
1070 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1072 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1073 css_property_t *cur;
1074 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1075 if (STRCASEEQ('l','L',"left", cur->value)) {
1076 attr_align = apr_pstrdup(doc->pool, "left");
1078 else if (STRCASEEQ('c','C',"center",cur->value)) {
1079 attr_align = apr_pstrdup(doc->pool, "center");
1081 else if (STRCASEEQ('r','R',"right",cur->value)) {
1082 attr_align = apr_pstrdup(doc->pool, "right");
1095 return chtml10->out;
1100 * It is a handler who processes the H1 tag.
1102 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1103 * destination is specified.
1104 * @param node [i] The H1 tag node is specified.
1105 * @return The conversion result is returned.
1108 s_chtml10_end_h1_tag(void *pdoc, Node *UNUSED(child))
1114 chtml10 = GET_CHTML10(pdoc);
1119 if (IS_CSS_ON(chtml10->entryp)) {
1120 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1123 return chtml10->out;
1128 * It is a handler who processes the H2 tag.
1130 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1131 * destination is specified.
1132 * @param node [i] The H2 tag node is specified.
1133 * @return The conversion result is returned.
1136 s_chtml10_start_h2_tag(void *pdoc, Node *node)
1141 char *attr_style = NULL;
1142 char *attr_align = NULL;
1144 chtml10 = GET_CHTML10(pdoc);
1147 for (attr = qs_get_attr(doc,node);
1149 attr = qs_get_next_attr(doc,attr)) {
1150 char *name = qs_get_attr_name(doc,attr);
1151 char *value = qs_get_attr_value(doc,attr);
1152 if (STRCASEEQ('a','A',"align", name)) {
1153 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1157 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1161 if (IS_CSS_ON(chtml10->entryp)) {
1162 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1164 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1165 css_property_t *cur;
1166 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1167 if (STRCASEEQ('l','L',"left", cur->value)) {
1168 attr_align = apr_pstrdup(doc->pool, "left");
1170 else if (STRCASEEQ('c','C',"center",cur->value)) {
1171 attr_align = apr_pstrdup(doc->pool, "center");
1173 else if (STRCASEEQ('r','R',"right",cur->value)) {
1174 attr_align = apr_pstrdup(doc->pool, "right");
1187 return chtml10->out;
1192 * It is a handler who processes the H2 tag.
1194 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1195 * destination is specified.
1196 * @param node [i] The H2 tag node is specified.
1197 * @return The conversion result is returned.
1200 s_chtml10_end_h2_tag(void *pdoc, Node *UNUSED(child))
1206 chtml10 = GET_CHTML10(pdoc);
1211 if (IS_CSS_ON(chtml10->entryp)) {
1212 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1215 return chtml10->out;
1220 * It is a handler who processes the H3 tag.
1222 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1223 * destination is specified.
1224 * @param node [i] The H3 tag node is specified.
1225 * @return The conversion result is returned.
1228 s_chtml10_start_h3_tag(void *pdoc, Node *node)
1233 char *attr_style = NULL;
1234 char *attr_align = NULL;
1236 chtml10 = GET_CHTML10(pdoc);
1239 for (attr = qs_get_attr(doc,node);
1241 attr = qs_get_next_attr(doc,attr)) {
1242 char *name = qs_get_attr_name(doc,attr);
1243 char *value = qs_get_attr_value(doc,attr);
1244 if (STRCASEEQ('a','A',"align", name)) {
1245 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1249 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1253 if (IS_CSS_ON(chtml10->entryp)) {
1254 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1256 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1257 css_property_t *cur;
1258 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1259 if (STRCASEEQ('l','L',"left", cur->value)) {
1260 attr_align = apr_pstrdup(doc->pool, "left");
1262 else if (STRCASEEQ('c','C',"center",cur->value)) {
1263 attr_align = apr_pstrdup(doc->pool, "center");
1265 else if (STRCASEEQ('r','R',"right",cur->value)) {
1266 attr_align = apr_pstrdup(doc->pool, "right");
1279 return chtml10->out;
1284 * It is a handler who processes the H3 tag.
1286 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1287 * destination is specified.
1288 * @param node [i] The H3 tag node is specified.
1289 * @return The conversion result is returned.
1292 s_chtml10_end_h3_tag(void *pdoc, Node *UNUSED(child))
1298 chtml10 = GET_CHTML10(pdoc);
1303 if (IS_CSS_ON(chtml10->entryp)) {
1304 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1307 return chtml10->out;
1312 * It is a handler who processes the H4 tag.
1314 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1315 * destination is specified.
1316 * @param node [i] The H4 tag node is specified.
1317 * @return The conversion result is returned.
1320 s_chtml10_start_h4_tag(void *pdoc, Node *node)
1325 char *attr_style = NULL;
1326 char *attr_align = NULL;
1328 chtml10 = GET_CHTML10(pdoc);
1331 for (attr = qs_get_attr(doc,node);
1333 attr = qs_get_next_attr(doc,attr)) {
1334 char *name = qs_get_attr_name(doc,attr);
1335 char *value = qs_get_attr_value(doc,attr);
1336 if (STRCASEEQ('a','A',"align", name)) {
1337 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1341 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1345 if (IS_CSS_ON(chtml10->entryp)) {
1346 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1348 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1349 css_property_t *cur;
1350 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1351 if (STRCASEEQ('l','L',"left", cur->value)) {
1352 attr_align = apr_pstrdup(doc->pool, "left");
1354 else if (STRCASEEQ('c','C',"center",cur->value)) {
1355 attr_align = apr_pstrdup(doc->pool, "center");
1357 else if (STRCASEEQ('r','R',"right",cur->value)) {
1358 attr_align = apr_pstrdup(doc->pool, "right");
1371 return chtml10->out;
1376 * It is a handler who processes the H4 tag.
1378 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1379 * destination is specified.
1380 * @param node [i] The H4 tag node is specified.
1381 * @return The conversion result is returned.
1384 s_chtml10_end_h4_tag(void *pdoc, Node *UNUSED(child))
1389 chtml10 = GET_CHTML10(pdoc);
1393 if (IS_CSS_ON(chtml10->entryp)) {
1394 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1397 return chtml10->out;
1402 * It is a handler who processes the H5 tag.
1404 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1405 * destination is specified.
1406 * @param node [i] The H5 tag node is specified.
1407 * @return The conversion result is returned.
1410 s_chtml10_start_h5_tag(void *pdoc, Node *node)
1415 char *attr_style = NULL;
1416 char *attr_align = NULL;
1418 chtml10 = GET_CHTML10(pdoc);
1421 for (attr = qs_get_attr(doc,node);
1423 attr = qs_get_next_attr(doc,attr)) {
1424 char *name = qs_get_attr_name(doc,attr);
1425 char *value = qs_get_attr_value(doc,attr);
1426 if (STRCASEEQ('a','A',"align", name)) {
1427 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1431 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1435 if (IS_CSS_ON(chtml10->entryp)) {
1436 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1438 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1439 css_property_t *cur;
1440 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1441 if (STRCASEEQ('l','L',"left", cur->value)) {
1442 attr_align = apr_pstrdup(doc->pool, "left");
1444 else if (STRCASEEQ('c','C',"center",cur->value)) {
1445 attr_align = apr_pstrdup(doc->pool, "center");
1447 else if (STRCASEEQ('r','R',"right",cur->value)) {
1448 attr_align = apr_pstrdup(doc->pool, "right");
1461 return chtml10->out;
1466 * It is a handler who processes the H5 tag.
1468 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1469 * destination is specified.
1470 * @param node [i] The H5 tag node is specified.
1471 * @return The conversion result is returned.
1474 s_chtml10_end_h5_tag(void *pdoc, Node *UNUSED(child))
1479 chtml10 = GET_CHTML10(pdoc);
1483 if (IS_CSS_ON(chtml10->entryp)) {
1484 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1487 return chtml10->out;
1492 * It is a handler who processes the H6 tag.
1494 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1495 * destination is specified.
1496 * @param node [i] The H6 tag node is specified.
1497 * @return The conversion result is returned.
1500 s_chtml10_start_h6_tag(void *pdoc, Node *node)
1505 char *attr_style = NULL;
1506 char *attr_align = NULL;
1508 chtml10 = GET_CHTML10(pdoc);
1511 for (attr = qs_get_attr(doc,node);
1513 attr = qs_get_next_attr(doc,attr)) {
1514 char *name = qs_get_attr_name(doc,attr);
1515 char *value = qs_get_attr_value(doc,attr);
1516 if (STRCASEEQ('a','A',"align", name)) {
1517 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1521 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1525 if (IS_CSS_ON(chtml10->entryp)) {
1526 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1528 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1529 css_property_t *cur;
1530 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1531 if (STRCASEEQ('l','L',"left", cur->value)) {
1532 attr_align = apr_pstrdup(doc->pool, "left");
1534 else if (STRCASEEQ('c','C',"center",cur->value)) {
1535 attr_align = apr_pstrdup(doc->pool, "center");
1537 else if (STRCASEEQ('r','R',"right",cur->value)) {
1538 attr_align = apr_pstrdup(doc->pool, "right");
1551 return chtml10->out;
1556 * It is a handler who processes the H6 tag.
1558 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1559 * destination is specified.
1560 * @param node [i] The H6 tag node is specified.
1561 * @return The conversion result is returned.
1564 s_chtml10_end_h6_tag(void *pdoc, Node *UNUSED(child))
1569 chtml10 = GET_CHTML10(pdoc);
1573 if (IS_CSS_ON(chtml10->entryp)) {
1574 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1577 return chtml10->out;
1582 * It is a handler who processes the TITLE tag.
1584 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1585 * destination is specified.
1586 * @param node [i] The TITLE tag node is specified.
1587 * @return The conversion result is returned.
1590 s_chtml10_start_title_tag(void *pdoc, Node *UNUSED(node))
1595 chtml10 = GET_CHTML10(pdoc);
1600 return chtml10->out;
1605 * It is a handler who processes the TITLE tag.
1607 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1608 * destination is specified.
1609 * @param node [i] The TITLE tag node is specified.
1610 * @return The conversion result is returned.
1613 s_chtml10_end_title_tag(void *pdoc, Node *UNUSED(child))
1618 chtml10 = GET_CHTML10(pdoc);
1623 return chtml10->out;
1628 * It is a handler who processes the BASE tag.
1630 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1631 * destination is specified.
1632 * @param node [i] The BASE tag node is specified.
1633 * @return The conversion result is returned.
1636 s_chtml10_start_base_tag(void *pdoc, Node *node)
1642 chtml10 = GET_CHTML10(pdoc);
1646 /*--------------------------------------------------------------------------*/
1647 /* Get Attributes */
1648 /*--------------------------------------------------------------------------*/
1649 for (attr = qs_get_attr(doc,node);
1651 attr = qs_get_next_attr(doc,attr)) {
1652 char *name = qs_get_attr_name(doc,attr);
1653 char *value = qs_get_attr_value(doc,attr);
1654 if (STRCASEEQ('h','H',"href", name)) {
1663 return chtml10->out;
1668 * It is a handler who processes the BASE tag.
1670 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1671 * destination is specified.
1672 * @param node [i] The BASE tag node is specified.
1673 * @return The conversion result is returned.
1676 s_chtml10_end_base_tag(void *pdoc, Node *UNUSED(child))
1678 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1680 return chtml10->out;
1685 * It is a handler who processes the BODY tag.
1687 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1688 * destination is specified.
1689 * @param node [i] The BODY tag node is specified.
1690 * @return The conversion result is returned.
1693 s_chtml10_start_body_tag(void *pdoc, Node *node)
1698 char *attr_style = NULL;
1700 chtml10 = GET_CHTML10(pdoc);
1703 /*--------------------------------------------------------------------------*/
1704 /* Get Attributes */
1705 /*--------------------------------------------------------------------------*/
1706 for (attr = qs_get_attr(doc,node);
1708 attr = qs_get_next_attr(doc,attr)) {
1709 char *name = qs_get_attr_name(doc,attr);
1710 char *value = qs_get_attr_value(doc,attr);
1714 if (strcasecmp(name, "alink") == 0) {
1715 /*----------------------------------------------------------------------*/
1717 /*----------------------------------------------------------------------*/
1724 if (strcasecmp(name, "bgcolor") == 0) {
1725 /*----------------------------------------------------------------------*/
1727 /*----------------------------------------------------------------------*/
1734 if (strcasecmp(name, "text") == 0) {
1735 /*----------------------------------------------------------------------*/
1737 /*----------------------------------------------------------------------*/
1744 if (strcasecmp(name, "link") == 0) {
1745 /*----------------------------------------------------------------------*/
1747 /*----------------------------------------------------------------------*/
1754 if (strcasecmp(name, "vlink") == 0) {
1755 /*----------------------------------------------------------------------*/
1757 /*----------------------------------------------------------------------*/
1764 if (strcasecmp("style", name) == 0 && value && *value) {
1774 if (IS_CSS_ON(chtml10->entryp)) {
1775 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1780 return chtml10->out;
1785 * It is a handler who processes the BODY tag.
1787 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1788 * destination is specified.
1789 * @param node [i] The BODY tag node is specified.
1790 * @return The conversion result is returned.
1793 s_chtml10_end_body_tag(void *pdoc, Node *UNUSED(child))
1798 chtml10 = GET_CHTML10(pdoc);
1802 if (IS_CSS_ON(chtml10->entryp)) {
1803 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1806 return chtml10->out;
1811 * It is a handler who processes the A tag.
1813 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1814 * destination is specified.
1815 * @param node [i] The A tag node is specified.
1816 * @return The conversion result is returned.
1819 s_chtml10_start_a_tag(void *pdoc, Node *node)
1825 char *attr_style = NULL;
1827 chtml10 = GET_CHTML10(pdoc);
1833 /*--------------------------------------------------------------------------*/
1834 /* Get Attributes */
1835 /*--------------------------------------------------------------------------*/
1836 for (attr = qs_get_attr(doc,node);
1838 attr = qs_get_next_attr(doc,attr)) {
1839 char *name = qs_get_attr_name(doc,attr);
1840 char *value = qs_get_attr_value(doc,attr);
1844 if (strcasecmp(name, "name") == 0) {
1845 /*--------------------------------------------------------------------*/
1847 /*--------------------------------------------------------------------*/
1856 if (strcasecmp(name, "href") == 0) {
1857 /*--------------------------------------------------------------------*/
1859 /*--------------------------------------------------------------------*/
1860 value = chxj_encoding_parameter(r, value, 0);
1861 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1862 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1872 if (strcasecmp(name, "accesskey") == 0) {
1873 /*--------------------------------------------------------------------*/
1875 /*--------------------------------------------------------------------*/
1876 W_L(" accesskey=\"");
1884 if (strcasecmp(name, "cti") == 0) {
1885 /*--------------------------------------------------------------------*/
1887 /*--------------------------------------------------------------------*/
1894 if (strcasecmp(name, "utn") == 0) {
1895 /*--------------------------------------------------------------------*/
1897 /*--------------------------------------------------------------------*/
1904 if (strcasecmp(name, "telbook") == 0) {
1905 /*--------------------------------------------------------------------*/
1907 /*--------------------------------------------------------------------*/
1914 if (strcasecmp(name, "kana") == 0) {
1915 /*--------------------------------------------------------------------*/
1917 /*--------------------------------------------------------------------*/
1924 if (strcasecmp(name, "email") == 0) {
1925 /*--------------------------------------------------------------------*/
1927 /*--------------------------------------------------------------------*/
1934 if (strcasecmp(name, "ista") == 0) {
1935 /*--------------------------------------------------------------------*/
1937 /*--------------------------------------------------------------------*/
1941 if (strcasecmp(name, "ilet") == 0) {
1942 /*--------------------------------------------------------------------*/
1944 /*--------------------------------------------------------------------*/
1948 if (strcasecmp(name, "iswf") == 0) {
1949 /*--------------------------------------------------------------------*/
1951 /*--------------------------------------------------------------------*/
1955 if (strcasecmp(name, "irst") == 0) {
1956 /*--------------------------------------------------------------------*/
1958 /*--------------------------------------------------------------------*/
1962 if (strcasecmp(name, "ijam") == 0) {
1963 /*--------------------------------------------------------------------*/
1965 /*--------------------------------------------------------------------*/
1972 if (strcasecmp(name, "style") == 0 && value && *value) {
1984 if (IS_CSS_ON(chtml10->entryp)) {
1985 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1987 return chtml10->out;
1992 * It is a handler who processes the A tag.
1994 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1995 * destination is specified.
1996 * @param node [i] The A tag node is specified.
1997 * @return The conversion result is returned.
2000 s_chtml10_end_a_tag(void *pdoc, Node *UNUSED(child))
2006 chtml10 = GET_CHTML10(pdoc);
2012 if (IS_CSS_ON(chtml10->entryp)) {
2013 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2016 return chtml10->out;
2021 * It is a handler who processes the BR tag.
2023 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2024 * destination is specified.
2025 * @param node [i] The BR tag node is specified.
2026 * @return The conversion result is returned.
2029 s_chtml10_start_br_tag(void *pdoc, Node *node)
2036 chtml10 = GET_CHTML10(pdoc);
2042 /*--------------------------------------------------------------------------*/
2043 /* Get Attributes */
2044 /*--------------------------------------------------------------------------*/
2045 for (attr = qs_get_attr(doc,node);
2047 attr = qs_get_next_attr(doc,attr)) {
2048 char *name = qs_get_attr_name(doc,attr);
2049 char *value = qs_get_attr_value(doc,attr);
2050 if (STRCASEEQ('c','C',"clear",name)) {
2051 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
2060 return chtml10->out;
2065 * It is a handler who processes the BR tag.
2067 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2068 * destination is specified.
2069 * @param node [i] The BR tag node is specified.
2070 * @return The conversion result is returned.
2073 s_chtml10_end_br_tag(void *pdoc, Node *UNUSED(child))
2075 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2077 return chtml10->out;
2082 * It is a handler who processes the TR tag.
2084 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2085 * destination is specified.
2086 * @param node [i] The TR tag node is specified.
2087 * @return The conversion result is returned.
2090 s_chtml10_start_tr_tag(void *pdoc, Node *UNUSED(node))
2092 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2094 return chtml10->out;
2099 * It is a handler who processes the TR tag.
2101 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2102 * destination is specified.
2103 * @param node [i] The TR tag node is specified.
2104 * @return The conversion result is returned.
2107 s_chtml10_end_tr_tag(void *pdoc, Node *UNUSED(child))
2113 chtml10 = GET_CHTML10(pdoc);
2119 return chtml10->out;
2124 * It is a handler who processes the FORM tag.
2126 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2127 * destination is specified.
2128 * @param node [i] The FORM tag node is specified.
2129 * @return The conversion result is returned.
2132 s_chtml10_start_form_tag(void *pdoc, Node *node)
2138 char *attr_style = NULL;
2139 char *attr_action = NULL;
2140 char *attr_method = NULL;
2141 char *new_hidden_tag = NULL;
2143 chtml10 = GET_CHTML10(pdoc);
2147 /*--------------------------------------------------------------------------*/
2148 /* Get Attributes */
2149 /*--------------------------------------------------------------------------*/
2150 for (attr = qs_get_attr(doc,node);
2152 attr = qs_get_next_attr(doc,attr)) {
2153 char *name = qs_get_attr_name(doc,attr);
2154 char *value = qs_get_attr_value(doc,attr);
2158 if (strcasecmp(name, "action") == 0) {
2159 /*--------------------------------------------------------------------*/
2161 /*--------------------------------------------------------------------*/
2162 attr_action = chxj_encoding_parameter(r, value, 0);
2163 attr_action = chxj_add_cookie_parameter(r, attr_action, chtml10->cookie);
2169 if (strcasecmp(name, "method") == 0) {
2170 /*--------------------------------------------------------------------*/
2172 /*--------------------------------------------------------------------*/
2173 attr_method = value;
2179 if (strcasecmp(name, "utn") == 0) {
2180 /*--------------------------------------------------------------------*/
2182 /*--------------------------------------------------------------------*/
2189 if (strcasecmp(name, "style") == 0 && value && *value) {
2198 if (IS_CSS_ON(chtml10->entryp)) {
2199 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2201 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
2206 char *new_query_string = NULL;
2207 q = strchr(attr_action, '?');
2209 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);
2210 if (new_hidden_tag || new_query_string) {
2216 if (new_query_string) {
2218 W_V(new_query_string);
2228 if (new_hidden_tag) {
2229 W_V(new_hidden_tag);
2232 return chtml10->out;
2237 * It is a handler who processes the FORM tag.
2239 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2240 * destination is specified.
2241 * @param node [i] The FORM tag node is specified.
2242 * @return The conversion result is returned.
2245 s_chtml10_end_form_tag(void *pdoc, Node *UNUSED(child))
2251 chtml10 = GET_CHTML10(pdoc);
2256 if (IS_CSS_ON(chtml10->entryp)) {
2257 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2260 return chtml10->out;
2265 * It is a handler who processes the INPUT tag.
2267 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2268 * destination is specified.
2269 * @param node [i] The INPUT tag node is specified.
2270 * @return The conversion result is returned.
2273 s_chtml10_start_input_tag(void *pdoc, Node *node)
2287 chtml10 = GET_CHTML10(pdoc);
2302 /*--------------------------------------------------------------------------*/
2303 /* Get Attributes */
2304 /*--------------------------------------------------------------------------*/
2306 type = qs_get_type_attr(doc, node, doc->buf.pool);
2307 name = qs_get_name_attr(doc, node, doc->buf.pool);
2308 value = qs_get_value_attr(doc,node,doc->buf.pool);
2309 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
2310 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
2311 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
2312 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
2313 size = qs_get_size_attr(doc, node, doc->buf.pool);
2316 type = qs_trim_string(doc->buf.pool, type);
2317 if (type && (STRCASEEQ('t','T',"text", type) ||
2318 STRCASEEQ('p','P',"password",type) ||
2319 STRCASEEQ('c','C',"checkbox",type) ||
2320 STRCASEEQ('r','R',"radio", type) ||
2321 STRCASEEQ('h','H',"hidden", type) ||
2322 STRCASEEQ('s','S',"submit", type) ||
2323 STRCASEEQ('r','R',"reset", type))) {
2330 if (size && *size != 0) {
2336 if (name && *name != 0) {
2342 if (value && *value != 0) {
2343 if (type && (STRCASEEQ('s','S',"submit",type) || STRCASEEQ('r','R',"reset",type))) {
2344 apr_size_t value_len = strlen(value);
2345 value = chxj_conv_z2h(r, value, &value_len, chtml10->entryp);
2349 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
2353 if (accesskey && *accesskey != 0) {
2354 W_L(" accesskey=\"");
2360 /*------------------------------------------------------------------------*/
2362 /*------------------------------------------------------------------------*/
2365 /*--------------------------------------------------------------------------*/
2366 /* The figure is default for the password. */
2367 /*--------------------------------------------------------------------------*/
2368 if (max_length && *max_length != 0) {
2369 W_L(" maxlength=\"");
2379 return chtml10->out;
2384 * It is a handler who processes the INPUT tag.
2386 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2387 * destination is specified.
2388 * @param node [i] The INPUT tag node is specified.
2389 * @return The conversion result is returned.
2392 s_chtml10_end_input_tag(void *pdoc, Node *UNUSED(child))
2394 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2396 return chtml10->out;
2401 * It is a handler who processes the CENTER tag.
2403 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2404 * destination is specified.
2405 * @param node [i] The CENTER tag node is specified.
2406 * @return The conversion result is returned.
2409 s_chtml10_start_center_tag(void *pdoc, Node *node)
2415 char *attr_style = NULL;
2417 chtml10 = GET_CHTML10(pdoc);
2421 for (attr = qs_get_attr(doc,node);
2423 attr = qs_get_next_attr(doc,attr)) {
2424 char *name = qs_get_attr_name(doc,attr);
2425 char *value = qs_get_attr_value(doc,attr);
2426 if (STRCASEEQ('s','S',"style",name) && value && *value) {
2432 if (IS_CSS_ON(chtml10->entryp)) {
2433 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2436 return chtml10->out;
2441 * It is a handler who processes the CENTER tag.
2443 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2444 * destination is specified.
2445 * @param node [i] The CENTER tag node is specified.
2446 * @return The conversion result is returned.
2449 s_chtml10_end_center_tag(void *pdoc, Node *UNUSED(child))
2455 chtml10 = GET_CHTML10(pdoc);
2460 if (IS_CSS_ON(chtml10->entryp)) {
2461 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2464 return chtml10->out;
2469 * It is a handler who processes the HR tag.
2471 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2472 * destination is specified.
2473 * @param node [i] The HR tag node is specified.
2474 * @return The conversion result is returned.
2477 s_chtml10_start_hr_tag(void *pdoc, Node *node)
2483 char *attr_align = NULL;
2484 char *attr_size = NULL;
2485 char *attr_width = NULL;
2486 char *attr_noshade = NULL;
2487 char *attr_style = NULL;
2489 chtml10 = GET_CHTML10(pdoc);
2493 for (attr = qs_get_attr(doc,node);
2495 attr = qs_get_next_attr(doc,attr)) {
2496 char *name = qs_get_attr_name (doc,attr);
2497 char *value = qs_get_attr_value(doc,attr);
2501 if (strcasecmp(name, "align") == 0) {
2502 /*--------------------------------------------------------------------*/
2504 /*--------------------------------------------------------------------*/
2505 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2513 if (strcasecmp(name, "size") == 0) {
2514 /*--------------------------------------------------------------------*/
2516 /*--------------------------------------------------------------------*/
2517 if (value && *value) {
2521 else if (strcasecmp(name, "style") == 0) {
2522 if (value && *value) {
2530 if (strcasecmp(name, "width") == 0) {
2531 /*--------------------------------------------------------------------*/
2533 /*--------------------------------------------------------------------*/
2534 if (value && *value) {
2542 if (strcasecmp(name, "noshade") == 0) {
2543 /*--------------------------------------------------------------------*/
2545 /*--------------------------------------------------------------------*/
2546 attr_noshade = apr_pstrdup(doc->pool, "noshade");
2552 if (strcasecmp(name, "color") == 0) {
2553 /*--------------------------------------------------------------------*/
2555 /*--------------------------------------------------------------------*/
2564 if (IS_CSS_ON(chtml10->entryp)) {
2565 css_prop_list_t *style = s_chtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2567 css_property_t *border_style_prop = chxj_css_get_property_value(doc, style, "border-style");
2568 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
2569 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
2570 css_property_t *cur;
2571 for (cur = border_style_prop->next; cur != border_style_prop; cur = cur->next) {
2572 if (STRCASEEQ('s','S',"solid",cur->value)) {
2573 attr_noshade = "noshade";
2576 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
2577 char *tmp = apr_pstrdup(doc->pool, cur->value);
2578 char *tmpp = strstr(tmp, "px");
2581 attr_size = apr_pstrdup(doc->pool, tmp);
2584 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
2585 char *tmp = apr_pstrdup(doc->pool, cur->value);
2586 char *tmpp = strstr(tmp, "px");
2589 attr_width = apr_pstrdup(doc->pool, tmp);
2592 tmpp = strstr(tmp, "%");
2594 attr_width = apr_pstrdup(doc->pool, tmp);
2620 return chtml10->out;
2625 * It is a handler who processes the HR tag.
2627 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2628 * destination is specified.
2629 * @param node [i] The HR tag node is specified.
2630 * @return The conversion result is returned.
2633 s_chtml10_end_hr_tag(void *pdoc, Node *UNUSED(child))
2635 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2637 return chtml10->out;
2642 * It is a handler who processes the IMG tag.
2644 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2645 * destination is specified.
2646 * @param node [i] The IMG tag node is specified.
2647 * @return The conversion result is returned.
2650 s_chtml10_start_img_tag(void *pdoc, Node *node)
2656 char *attr_src = NULL;
2657 char *attr_align = NULL;
2658 char *attr_style = NULL;
2659 char *attr_alt = NULL;
2660 char *attr_width = NULL;
2661 char *attr_height = NULL;
2662 char *attr_hspace = NULL;
2663 char *attr_vspace = NULL;
2664 #ifndef IMG_NOT_CONVERT_FILENAME
2668 chtml10 = GET_CHTML10(pdoc);
2669 #ifndef IMG_NOT_CONVERT_FILENAME
2670 spec = chtml10->spec;
2675 /*--------------------------------------------------------------------------*/
2676 /* Get Attributes */
2677 /*--------------------------------------------------------------------------*/
2678 for (attr = qs_get_attr(doc,node);
2680 attr = qs_get_next_attr(doc,attr)) {
2681 char *name = qs_get_attr_name (doc,attr);
2682 char *value = qs_get_attr_value(doc,attr);
2686 if (strcasecmp(name, "src") == 0) {
2687 /*--------------------------------------------------------------------*/
2689 /*--------------------------------------------------------------------*/
2690 #ifdef IMG_NOT_CONVERT_FILENAME
2691 value = chxj_encoding_parameter(r, value, 0);
2692 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2693 value = chxj_add_cookie_no_update_parameter(r, value);
2696 value = chxj_img_conv(r, spec, value);
2697 value = chxj_encoding_parameter(r, value, 0);
2698 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2699 value = chxj_add_cookie_no_update_parameter(r, value);
2703 else if (strcasecmp(name,"style") == 0 && value && *value) {
2710 if (strcasecmp(name, "align" ) == 0) {
2711 /*--------------------------------------------------------------------*/
2713 /*--------------------------------------------------------------------*/
2714 /*--------------------------------------------------------------------*/
2716 /*--------------------------------------------------------------------*/
2718 if (STRCASEEQ('t','T',"top", value) ||
2719 STRCASEEQ('m','M',"middle",value) ||
2720 STRCASEEQ('b','B',"bottom",value) ||
2721 STRCASEEQ('l','L',"left", value) ||
2722 STRCASEEQ('r','R',"right", value)) {
2725 else if (STRCASEEQ('c','C',"center", value)) {
2726 attr_align = apr_pstrdup(doc->pool, "middle");
2730 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2731 /*--------------------------------------------------------------------*/
2733 /*--------------------------------------------------------------------*/
2740 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2741 /*--------------------------------------------------------------------*/
2743 /*--------------------------------------------------------------------*/
2750 if (strcasecmp(name, "height") == 0 && value && *value) {
2751 /*--------------------------------------------------------------------*/
2753 /*--------------------------------------------------------------------*/
2754 attr_height = value;
2757 if (strcasecmp(name, "hspace") == 0 && value && *value) {
2758 /*--------------------------------------------------------------------*/
2760 /*--------------------------------------------------------------------*/
2761 attr_hspace = value;
2767 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2768 /*--------------------------------------------------------------------*/
2770 /*--------------------------------------------------------------------*/
2771 attr_vspace = value;
2780 if (IS_CSS_ON(chtml10->entryp)) {
2781 css_prop_list_t *style = s_chtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2783 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
2784 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
2785 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
2786 css_property_t *cur;
2787 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
2788 attr_height = apr_pstrdup(doc->pool, cur->value);
2790 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
2791 attr_width = apr_pstrdup(doc->pool, cur->value);
2793 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
2794 attr_align = apr_pstrdup(doc->pool, cur->value);
2836 return chtml10->out;
2841 * It is a handler who processes the IMG tag.
2843 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
2844 * destination is specified.
2845 * @param node [i] The IMG tag node is specified.
2846 * @return The conversion result is returned.
2849 s_chtml10_end_img_tag(void *pdoc, Node *UNUSED(child))
2851 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2852 return chtml10->out;
2857 * It is a handler who processes the SELECT tag.
2859 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2860 * destination is specified.
2861 * @param node [i] The SELECT tag node is specified.
2862 * @return The conversion result is returned.
2865 s_chtml10_start_select_tag(void *pdoc, Node *node)
2871 char *attr_style = NULL;
2876 chtml10 = GET_CHTML10(pdoc);
2884 for (attr = qs_get_attr(doc,node);
2886 attr = qs_get_next_attr(doc,attr)) {
2887 char *nm = qs_get_attr_name (doc,attr);
2888 char *val = qs_get_attr_value(doc,attr);
2892 if (strcasecmp(nm, "size") == 0) {
2893 /*--------------------------------------------------------------------*/
2894 /* CHTML 1.0 version 2.0 */
2895 /*--------------------------------------------------------------------*/
2896 size = apr_pstrdup(doc->buf.pool, val);
2898 else if (strcasecmp(nm, "style") == 0 && val && *val) {
2899 /*--------------------------------------------------------------------*/
2900 /* CHTML 1.0 version 2.0 */
2901 /*--------------------------------------------------------------------*/
2902 attr_style = apr_pstrdup(doc->buf.pool, val);
2908 if (strcasecmp(nm, "name") == 0) {
2909 /*--------------------------------------------------------------------*/
2910 /* CHTML 1.0 version 2.0 */
2911 /*--------------------------------------------------------------------*/
2912 name = apr_pstrdup(doc->buf.pool, val);
2918 if (strcasecmp(nm, "multiple") == 0) {
2919 /*--------------------------------------------------------------------*/
2920 /* CHTML 1.0 version 2.0 */
2921 /*--------------------------------------------------------------------*/
2931 if (size && *size != 0) {
2937 if (name && *name != 0) {
2944 if (IS_CSS_ON(chtml10->entryp)) {
2945 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2947 return chtml10->out;
2952 * It is a handler who processes the SELECT tag.
2954 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2955 * destination is specified.
2956 * @param node [i] The SELECT tag node is specified.
2957 * @return The conversion result is returned.
2960 s_chtml10_end_select_tag(void *pdoc, Node *UNUSED(child))
2966 chtml10 = GET_CHTML10(pdoc);
2971 if (IS_CSS_ON(chtml10->entryp)) {
2972 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2974 return chtml10->out;
2979 * It is a handler who processes the OPTION tag.
2981 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2982 * destination is specified.
2983 * @param node [i] The OPTION tag node is specified.
2984 * @return The conversion result is returned.
2987 s_chtml10_start_option_tag(void *pdoc, Node *node)
2995 char *attr_style = NULL;
2997 chtml10 = GET_CHTML10(pdoc);
3006 for (attr = qs_get_attr(doc,node);
3008 attr = qs_get_next_attr(doc,attr)) {
3009 char *nm = qs_get_attr_name (doc,attr);
3010 char *val = qs_get_attr_value(doc,attr);
3014 if (strcasecmp(nm, "selected") == 0) {
3015 /*--------------------------------------------------------------------*/
3016 /* CHTML 1.0 version 2.0 */
3017 /*--------------------------------------------------------------------*/
3018 selected = apr_pstrdup(doc->buf.pool, val);
3020 else if (strcasecmp(nm, "style") == 0 && val && *val) {
3021 /*--------------------------------------------------------------------*/
3022 /* CHTML 1.0 version 2.0 */
3023 /*--------------------------------------------------------------------*/
3024 attr_style = apr_pstrdup(doc->buf.pool, val);
3030 if (strcasecmp(nm, "value") == 0) {
3031 /*--------------------------------------------------------------------*/
3032 /* CHTML 1.0 version 2.0 */
3033 /*--------------------------------------------------------------------*/
3034 value = apr_pstrdup(doc->buf.pool, val);
3054 if (IS_CSS_ON(chtml10->entryp)) {
3055 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3057 return chtml10->out;
3062 * It is a handler who processes the OPTION tag.
3064 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3065 * destination is specified.
3066 * @param node [i] The OPTION tag node is specified.
3067 * @return The conversion result is returned.
3070 s_chtml10_end_option_tag(void *pdoc, Node *UNUSED(child))
3072 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3075 if (IS_CSS_ON(chtml10->entryp)) {
3076 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3079 return chtml10->out;
3084 * It is a handler who processes the DIV tag.
3086 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3087 * destination is specified.
3088 * @param node [i] The DIV tag node is specified.
3089 * @return The conversion result is returned.
3092 s_chtml10_start_div_tag(void *pdoc, Node *node)
3098 char *attr_align = NULL;
3099 char *attr_style = NULL;
3101 chtml10 = GET_CHTML10(pdoc);
3105 for (attr = qs_get_attr(doc,node);
3107 attr = qs_get_next_attr(doc,attr)) {
3108 char *nm = qs_get_attr_name(doc,attr);
3109 char *val = qs_get_attr_value(doc,attr);
3110 if (STRCASEEQ('a','A',"align", nm)) {
3111 /*----------------------------------------------------------------------*/
3112 /* CHTML 1.0 (W3C version 3.2) */
3113 /*----------------------------------------------------------------------*/
3114 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3115 attr_align = apr_pstrdup(doc->buf.pool, val);
3118 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3119 attr_style = apr_pstrdup(doc->pool, val);
3122 if (IS_CSS_ON(chtml10->entryp)) {
3123 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3125 css_property_t *text_align = chxj_css_get_property_value(doc, style, "text-align");
3126 css_property_t *cur;
3127 for (cur = text_align->next; cur != text_align; cur = cur->next) {
3128 if (STRCASEEQ('l','L',"left",cur->value)) {
3129 attr_align = apr_pstrdup(doc->pool, "left");
3131 else if (STRCASEEQ('c','C',"center",cur->value)) {
3132 attr_align = apr_pstrdup(doc->pool, "center");
3134 else if (STRCASEEQ('r','R',"right",cur->value)) {
3135 attr_align = apr_pstrdup(doc->pool, "right");
3149 return chtml10->out;
3154 * It is a handler who processes the DIV tag.
3156 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3157 * destination is specified.
3158 * @param node [i] The DIV tag node is specified.
3159 * @return The conversion result is returned.
3162 s_chtml10_end_div_tag(void *pdoc, Node *UNUSED(child))
3168 chtml10 = GET_CHTML10(pdoc);
3174 if (IS_CSS_ON(chtml10->entryp)) {
3175 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3178 return chtml10->out;
3183 * It is a handler who processes the CHXJ:IF tag.
3185 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3186 * destination is specified.
3187 * @param node [i] The CHXJ:IF tag node is specified.
3188 * @return The conversion result is returned.
3191 s_chtml10_chxjif_tag(void *pdoc, Node *node)
3198 chtml10 = GET_CHTML10(pdoc);
3202 for (child = qs_get_child_node(doc, node);
3204 child = qs_get_next_node(doc, child)) {
3206 s_chtml10_chxjif_tag(chtml10, child);
3209 return chtml10->out;
3214 * It is a handler who processes the PRE tag.
3216 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3217 * destination is specified.
3218 * @param node [i] The PRE tag node is specified.
3219 * @return The conversion result is returned.
3222 s_chtml10_start_pre_tag(void *pdoc, Node *node)
3228 char *attr_style = NULL;
3230 chtml10 = GET_CHTML10(pdoc);
3234 for (attr = qs_get_attr(doc,node);
3236 attr = qs_get_next_attr(doc,attr)) {
3237 char *nm = qs_get_attr_name(doc,attr);
3238 char *val = qs_get_attr_value(doc,attr);
3239 if (val && STRCASEEQ('s','S',"style", nm)) {
3244 if (IS_CSS_ON(chtml10->entryp)) {
3245 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3247 chtml10->pre_flag++;
3249 return chtml10->out;
3254 * It is a handler who processes the PRE tag.
3256 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3257 * destination is specified.
3258 * @param node [i] The PRE tag node is specified.
3259 * @return The conversion result is returned.
3262 s_chtml10_end_pre_tag(void *pdoc, Node *UNUSED(child))
3268 chtml10 = GET_CHTML10(pdoc);
3273 chtml10->pre_flag--;
3274 if (IS_CSS_ON(chtml10->entryp)) {
3275 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3278 return chtml10->out;
3283 * It is a handler who processes the P tag.
3285 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3286 * destination is specified.
3287 * @param node [i] The P tag node is specified.
3288 * @return The conversion result is returned.
3291 s_chtml10_start_p_tag(void *pdoc, Node *node)
3297 char *attr_align = NULL;
3298 char *attr_style = NULL;
3300 chtml10 = GET_CHTML10(pdoc);
3304 for (attr = qs_get_attr(doc,node);
3306 attr = qs_get_next_attr(doc,attr)) {
3307 char *nm = qs_get_attr_name(doc,attr);
3308 char *val = qs_get_attr_value(doc,attr);
3309 if (STRCASEEQ('a','A',"align", nm)) {
3310 /*----------------------------------------------------------------------*/
3311 /* CHTML 1.0 (W3C version 3.2) */
3312 /*----------------------------------------------------------------------*/
3313 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3314 attr_align = apr_pstrdup(doc->buf.pool, val);
3318 else if (val && STRCASEEQ('s','S',"style", nm)) {
3322 if (IS_CSS_ON(chtml10->entryp)) {
3323 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3325 css_property_t *text_align = chxj_css_get_property_value(doc, style, "text-align");
3326 css_property_t *cur;
3327 for (cur = text_align->next; cur != text_align; cur = cur->next) {
3328 if (STRCASEEQ('l','L',"left",cur->value)) {
3329 attr_align = apr_pstrdup(doc->pool, "left");
3331 else if (STRCASEEQ('c','C',"center",cur->value)) {
3332 attr_align = apr_pstrdup(doc->pool, "center");
3334 else if (STRCASEEQ('r','R',"right",cur->value)) {
3335 attr_align = apr_pstrdup(doc->pool, "right");
3347 return chtml10->out;
3352 * It is a handler who processes the P tag.
3354 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3355 * destination is specified.
3356 * @param node [i] The P tag node is specified.
3357 * @return The conversion result is returned.
3360 s_chtml10_end_p_tag(void *pdoc, Node *UNUSED(child))
3366 chtml10 = GET_CHTML10(pdoc);
3371 if (IS_CSS_ON(chtml10->entryp)) {
3372 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3374 return chtml10->out;
3379 * It is a handler who processes the TEXTARE tag.
3381 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3382 * destination is specified.
3383 * @param node [i] The TEXTAREA tag node is specified.
3384 * @return The conversion result is returned.
3387 s_chtml10_start_textarea_tag(void *pdoc, Node *node)
3394 chtml10 = GET_CHTML10(pdoc);
3398 chtml10->textarea_flag++;
3402 for (attr = qs_get_attr(doc,node);
3404 attr = qs_get_next_attr(doc,attr)) {
3405 char *name = qs_get_attr_name (doc,attr);
3406 char *value = qs_get_attr_value(doc,attr);
3410 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
3411 W_L(" accesskey=\"");
3419 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
3428 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3437 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3449 return chtml10->out;
3454 * It is a handler who processes the TEXTAREA tag.
3456 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3457 * destination is specified.
3458 * @param node [i] The TEXTAREA tag node is specified.
3459 * @return The conversion result is returned.
3462 s_chtml10_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3468 chtml10 = GET_CHTML10(pdoc);
3473 chtml10->textarea_flag--;
3475 return chtml10->out;
3480 s_chtml10_text(void *pdoc, Node *child)
3491 apr_size_t z2h_input_len;
3493 chtml10 = GET_CHTML10(pdoc);
3497 textval = qs_get_node_value(doc,child);
3498 if (strlen(textval) == 0) {
3499 return chtml10->out;
3502 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3503 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3505 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3506 memset(one_byte, 0, sizeof(one_byte));
3509 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3513 rtn = s_chtml10_search_emoji(chtml10, &textval[ii], &out);
3515 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3520 if (is_sjis_kanji(textval[ii])) {
3521 one_byte[0] = textval[ii+0];
3522 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3523 one_byte[0] = textval[ii+1];
3524 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3528 if (chtml10->pre_flag) {
3529 one_byte[0] = textval[ii+0];
3530 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3533 if (chtml10->textarea_flag) {
3534 one_byte[0] = textval[ii+0];
3535 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3538 if (textval[ii] != '\r' && textval[ii] != '\n') {
3539 one_byte[0] = textval[ii+0];
3540 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3544 z2h_input_len = strlen(tdst);
3545 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, chtml10->entryp);
3548 return chtml10->out;
3553 * It is a handler who processes the BLOCKQUOTE tag.
3555 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3556 * destination is specified.
3557 * @param node [i] The BLOCKQUOTE tag node is specified.
3558 * @return The conversion result is returned.
3561 s_chtml10_start_blockquote_tag(void *pdoc, Node *node)
3566 char *attr_style = NULL;
3568 chtml10 = GET_CHTML10(pdoc);
3570 for (attr = qs_get_attr(doc,node);
3572 attr = qs_get_next_attr(doc,attr)) {
3573 char *nm = qs_get_attr_name(doc,attr);
3574 char *val = qs_get_attr_value(doc,attr);
3575 if (val && STRCASEEQ('s','S',"style", nm)) {
3579 W_L("<blockquote>");
3580 if (IS_CSS_ON(chtml10->entryp)) {
3581 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3583 return chtml10->out;
3588 * It is a handler who processes the BLOCKQUOTE tag.
3590 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3591 * destination is specified.
3592 * @param node [i] The BLOCKQUOTE tag node is specified.
3593 * @return The conversion result is returned.
3596 s_chtml10_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3601 chtml10 = GET_CHTML10(pdoc);
3603 W_L("</blockquote>");
3604 if (IS_CSS_ON(chtml10->entryp)) {
3605 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3607 return chtml10->out;
3612 * It is a handler who processes the DIR tag.
3614 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3615 * destination is specified.
3616 * @param node [i] The DIR tag node is specified.
3617 * @return The conversion result is returned.
3620 s_chtml10_start_dir_tag(void *pdoc, Node *node)
3625 char *attr_style = NULL;
3627 chtml10 = GET_CHTML10(pdoc);
3630 for (attr = qs_get_attr(doc,node);
3632 attr = qs_get_next_attr(doc,attr)) {
3633 char *nm = qs_get_attr_name(doc,attr);
3634 char *val = qs_get_attr_value(doc,attr);
3635 if (val && STRCASEEQ('s','S',"style", nm)) {
3641 if (IS_CSS_ON(chtml10->entryp)) {
3642 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3644 return chtml10->out;
3649 * It is a handler who processes the DIR tag.
3651 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3652 * destination is specified.
3653 * @param node [i] The DIR tag node is specified.
3654 * @return The conversion result is returned.
3657 s_chtml10_end_dir_tag(void *pdoc, Node *UNUSED(child))
3662 chtml10 = GET_CHTML10(pdoc);
3666 if (IS_CSS_ON(chtml10->entryp)) {
3667 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3669 return chtml10->out;
3674 * It is a handler who processes the DL tag.
3676 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3677 * destination is specified.
3678 * @param node [i] The DL tag node is specified.
3679 * @return The conversion result is returned.
3682 s_chtml10_start_dl_tag(void *pdoc, Node *node)
3687 char *attr_style = NULL;
3689 chtml10 = GET_CHTML10(pdoc);
3692 for (attr = qs_get_attr(doc,node);
3694 attr = qs_get_next_attr(doc,attr)) {
3695 char *nm = qs_get_attr_name(doc,attr);
3696 char *val = qs_get_attr_value(doc,attr);
3697 if (val && STRCASEEQ('s','S',"style", nm)) {
3701 if (IS_CSS_ON(chtml10->entryp)) {
3702 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3705 return chtml10->out;
3710 * It is a handler who processes the DL tag.
3712 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3713 * destination is specified.
3714 * @param node [i] The DL tag node is specified.
3715 * @return The conversion result is returned.
3718 s_chtml10_end_dl_tag(void *pdoc, Node *UNUSED(child))
3722 chtml10 = GET_CHTML10(pdoc);
3725 if (IS_CSS_ON(chtml10->entryp)) {
3726 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3728 return chtml10->out;
3733 * It is a handter who processes the DT tag.
3735 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3736 * destination is specified.
3737 * @param node [i] The DT tag node is specified.
3738 * @return The conversion result is returned.
3741 s_chtml10_start_dt_tag(void *pdoc, Node *node)
3746 char *attr_style = NULL;
3748 chtml10 = GET_CHTML10(pdoc);
3751 for (attr = qs_get_attr(doc,node);
3753 attr = qs_get_next_attr(doc,attr)) {
3754 char *nm = qs_get_attr_name(doc,attr);
3755 char *val = qs_get_attr_value(doc,attr);
3756 if (val && STRCASEEQ('s','S',"style", nm)) {
3761 if (IS_CSS_ON(chtml10->entryp)) {
3762 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3764 return chtml10->out;
3769 * It is a handter who processes the DT tag.
3771 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3772 * destination is specified.
3773 * @param node [i] The DT tag node is specified.
3774 * @return The conversion result is returned.
3777 s_chtml10_end_dt_tag(void *pdoc, Node *UNUSED(child))
3779 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3780 if (IS_CSS_ON(chtml10->entryp)) {
3781 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3783 return chtml10->out;
3788 * It is a handder who processes the DD tag.
3790 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3791 * destination is specified.
3792 * @param node [i] The DD tag node is specified.
3793 * @return The conversion result is returned.
3796 s_chtml10_start_dd_tag(void *pdoc, Node *node)
3798 CHTML10_PUSH_ONLY("<dd>");
3803 * It is a handder who processes the DD tag.
3805 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3806 * destination is specified.
3807 * @param node [i] The DD tag node is specified.
3808 * @return The conversion result is returned.
3811 s_chtml10_end_dd_tag(void *pdoc, Node *UNUSED(child))
3813 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3814 if (IS_CSS_ON(chtml10->entryp)) {
3815 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3817 return chtml10->out;
3822 * It is a hanmenuer who processes the MENU tag.
3824 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3825 * destination is specified.
3826 * @param node [i] The MENU tag node is specified.
3827 * @return The conversion result is returned.
3830 s_chtml10_start_menu_tag(void *pdoc, Node *node)
3832 CHTML10_PUSH_ONLY("<menu>");
3837 * It is a hanmenuer who processes the MENU tag.
3839 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3840 * destination is specified.
3841 * @param node [i] The MENU tag node is specified.
3842 * @return The conversion result is returned.
3845 s_chtml10_end_menu_tag(void *pdoc, Node *UNUSED(child))
3847 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3848 Doc *doc = chtml10->doc;
3850 if (IS_CSS_ON(chtml10->entryp)) {
3851 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3853 return chtml10->out;
3858 * It is a handler who processes the PLAINTEXT tag.
3860 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3861 * destination is specified.
3862 * @param node [i] The PLAINTEXT tag node is specified.
3863 * @return The conversion result is returned.
3866 s_chtml10_start_plaintext_tag(void *pdoc, Node *node)
3871 chtml10 = GET_CHTML10(pdoc);
3874 s_chtml10_start_plaintext_tag_inner(pdoc,node);
3875 return chtml10->out;
3879 s_chtml10_start_plaintext_tag_inner(void *pdoc, Node *node)
3884 chtml10 = GET_CHTML10(pdoc);
3886 for (child = qs_get_child_node(doc, node);
3888 child = qs_get_next_node(doc, child)) {
3890 s_chtml10_start_plaintext_tag_inner(pdoc, child);
3892 return chtml10->out;
3897 * It is a handler who processes the PLAINTEXT tag.
3899 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3900 * destination is specified.
3901 * @param node [i] The PLAINTEXT tag node is specified.
3902 * @return The conversion result is returned.
3905 s_chtml10_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3907 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3908 return chtml10->out;
3913 * It is a handler who processes the LINK tag.
3915 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3916 * destination is specified.
3917 * @param node [i] The LINK tag node is specified.
3918 * @return The conversion result is returned.
3921 s_chtml10_link_tag(void *pdoc, Node *node)
3930 chtml10 = GET_CHTML10(pdoc);
3933 if (! IS_CSS_ON(chtml10->entryp)) {
3934 return chtml10->out;
3937 for (attr = qs_get_attr(doc,node);
3939 attr = qs_get_next_attr(doc,attr)) {
3940 char *name = qs_get_attr_name(doc,attr);
3941 char *value = qs_get_attr_value(doc,attr);
3942 if (STRCASEEQ('r','R',"rel", name)) {
3943 if (value && *value && STRCASEEQ('s','S',"stylesheet", value)) {
3947 else if (STRCASEEQ('h','H',"href", name)) {
3948 if (value && *value) {
3952 else if (STRCASEEQ('t','T',"type", name)) {
3953 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
3959 if (rel && href && type) {
3960 DBG(doc->r, "start load CSS. url:[%s]", href);
3961 chtml10->style = chxj_css_parse_from_uri(doc->r, doc->pool, chtml10->style, href);
3962 DBG(doc->r, "end load CSS. url:[%s]", href);
3965 return chtml10->out;
3969 * It is a handler who processes the STYLE tag.
3971 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3972 * destination is specified.
3973 * @param node [i] The STYLE tag node is specified.
3974 * @return The conversion result is returned.
3977 s_chtml10_style_tag(void *pdoc, Node *node)
3984 chtml10 = GET_CHTML10(pdoc);
3987 if (! IS_CSS_ON(chtml10->entryp)) {
3988 return chtml10->out;
3991 for (attr = qs_get_attr(doc,node);
3993 attr = qs_get_next_attr(doc,attr)) {
3994 char *name = qs_get_attr_name(doc,attr);
3995 char *value = qs_get_attr_value(doc,attr);
3996 if (STRCASEEQ('t','T',"type", name)) {
3997 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
4003 Node *child = qs_get_child_node(doc, node);
4004 if (type && child) {
4005 char *name = qs_get_node_name(doc, child);
4006 if (STRCASEEQ('t','T',"text", name)) {
4007 char *value = qs_get_node_value(doc, child);
4008 DBG(doc->r, "start load CSS. buf:[%s]", value);
4009 chtml10->style = chxj_css_parse_style_value(doc, chtml10->style, value);
4010 DBG(doc->r, "end load CSS. value:[%s]", value);
4013 return chtml10->out;
4018 s_chtml10_newline_mark(void *pdoc, Node *UNUSED(node))
4020 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4021 Doc *doc = chtml10->doc;
4023 return chtml10->out;
4026 static css_prop_list_t *
4027 s_chtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
4029 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4030 Doc *doc = chtml10->doc;
4031 css_prop_list_t *last_css = NULL;
4032 if (IS_CSS_ON(chtml10->entryp)) {
4033 css_prop_list_t *dup_css;
4034 css_selector_t *selector;
4036 last_css = chxj_css_get_last_prop_list(chtml10->css_prop_stack);
4037 dup_css = chxj_dup_css_prop_list(doc, last_css);
4038 selector = chxj_css_find_selector(doc, chtml10->style, node);
4040 chxj_css_prop_list_merge_property(doc, dup_css, selector);
4042 chxj_css_push_prop_list(chtml10->css_prop_stack, dup_css);
4043 last_css = chxj_css_get_last_prop_list(chtml10->css_prop_stack);
4045 if (style_attr_value) {
4046 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));
4048 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
4056 static css_prop_list_t *
4057 s_chtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
4059 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4060 Doc *doc = chtml10->doc;
4061 css_prop_list_t *last_css = NULL;
4062 if (IS_CSS_ON(chtml10->entryp)) {
4063 css_prop_list_t *dup_css;
4064 css_selector_t *selector;
4066 last_css = chxj_css_get_last_prop_list(chtml10->css_prop_stack);
4067 dup_css = chxj_dup_css_prop_list(doc, last_css);
4068 selector = chxj_css_find_selector(doc, chtml10->style, node);
4070 chxj_css_prop_list_merge_property(doc, dup_css, selector);
4074 if (style_attr_value) {
4075 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));
4077 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
4087 * It is a handler who processes the SPAN tag.
4089 * @param pdoc [i/o] The pointer to the CHTML structure at the output
4090 * destination is specified.
4091 * @param node [i] The SPAN tag node is specified.
4092 * @return The conversion result is returned.
4095 s_chtml10_start_span_tag(void *pdoc, Node *node)
4100 char *attr_style = NULL;
4101 char *attr_color = NULL;
4102 char *attr_align = NULL;
4104 chtml10 = GET_CHTML10(pdoc);
4107 for (attr = qs_get_attr(doc,node);
4109 attr = qs_get_next_attr(doc,attr)) {
4110 char *nm = qs_get_attr_name(doc,attr);
4111 char *val = qs_get_attr_value(doc,attr);
4112 if (val && STRCASEEQ('s','S',"style", nm)) {
4116 if (IS_CSS_ON(chtml10->entryp)) {
4117 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
4119 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4120 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
4121 css_property_t *cur;
4122 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4123 attr_color = apr_pstrdup(doc->pool, cur->value);
4125 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
4126 if (STRCASEEQ('l','L',"left", cur->value)) {
4127 attr_align = apr_pstrdup(doc->pool, "left");
4129 else if (STRCASEEQ('c','C',"center",cur->value)) {
4130 attr_align = apr_pstrdup(doc->pool, "center");
4132 else if (STRCASEEQ('r','R',"right",cur->value)) {
4133 attr_align = apr_pstrdup(doc->pool, "right");
4138 if (attr_color || attr_align) {
4139 chtml10_flags_t *flg = apr_palloc(doc->pool, sizeof(*flg));
4140 memset(flg, 0, sizeof(*flg));
4142 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4143 W_L("<font color=\"");
4146 flg->with_font_flag = 1;
4149 W_L("<div align=\"");
4152 flg->with_div_flag = 1;
4154 node->userData = flg;
4157 node->userData = NULL;
4159 return chtml10->out;
4164 * It is a handler who processes the SPAN tag.
4166 * @param pdoc [i/o] The pointer to the CHTML structure at the output
4167 * destination is specified.
4168 * @param node [i] The SPAN tag node is specified.
4169 * @return The conversion result is returned.
4172 s_chtml10_end_span_tag(void *pdoc, Node *node)
4174 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4175 Doc *doc = chtml10->doc;
4177 chtml10_flags_t *flg = (chtml10_flags_t *)node->userData;
4178 if (flg && flg->with_div_flag) {
4181 if (flg && flg->with_font_flag) {
4184 if (IS_CSS_ON(chtml10->entryp)) {
4185 chxj_css_pop_prop_list(chtml10->css_prop_stack);
4187 return chtml10->out;