2 * Copyright (C) 2005-2008 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_jhtml.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_encoding.h"
23 #include "chxj_url_encode.h"
26 #define GET_JHTML(X) ((jhtml_t *)(X))
29 #define W_L(X) do { jhtml->out = BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, (X)); } while(0)
30 #define W_V(X) do { jhtml->out = (X) ? BUFFERED_WRITE_VALUE(jhtml->out, &doc->buf, (X)) \
31 : BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, ""); } while(0)
33 static char *s_jhtml_start_html_tag (void *pdoc, Node *node);
34 static char *s_jhtml_end_html_tag (void *pdoc, Node *node);
35 static char *s_jhtml_start_meta_tag (void *pdoc, Node *node);
36 static char *s_jhtml_end_meta_tag (void *pdoc, Node *node);
37 static char *s_jhtml_start_head_tag (void *pdoc, Node *node);
38 static char *s_jhtml_end_head_tag (void *pdoc, Node *node);
39 static char *s_jhtml_start_title_tag (void *pdoc, Node *node);
40 static char *s_jhtml_end_title_tag (void *pdoc, Node *node);
41 static char *s_jhtml_start_base_tag (void *pdoc, Node *node);
42 static char *s_jhtml_end_base_tag (void *pdoc, Node *node);
43 static char *s_jhtml_start_body_tag (void *pdoc, Node *node);
44 static char *s_jhtml_end_body_tag (void *pdoc, Node *node);
45 static char *s_jhtml_start_a_tag (void *pdoc, Node *node);
46 static char *s_jhtml_end_a_tag (void *pdoc, Node *node);
47 static char *s_jhtml_start_pre_tag (void *pdoc, Node *node);
48 static char *s_jhtml_end_pre_tag (void *pdoc, Node *node);
49 static char *s_jhtml_start_p_tag (void *pdoc, Node *node);
50 static char *s_jhtml_end_p_tag (void *pdoc, Node *node);
51 static char *s_jhtml_start_ul_tag (void *pdoc, Node *node);
52 static char *s_jhtml_end_ul_tag (void *pdoc, Node *node);
53 static char *s_jhtml_start_ol_tag (void *pdoc, Node *node);
54 static char *s_jhtml_end_ol_tag (void *pdoc, Node *node);
55 static char *s_jhtml_start_li_tag (void *pdoc, Node *node);
56 static char *s_jhtml_end_li_tag (void *pdoc, Node *node);
57 static char *s_jhtml_start_br_tag (void *pdoc, Node *node);
58 static char *s_jhtml_end_br_tag (void *pdoc, Node *node);
59 static char *s_jhtml_start_tr_tag (void *pdoc, Node *node);
60 static char *s_jhtml_end_tr_tag (void *pdoc, Node *node);
61 static char *s_jhtml_start_font_tag (void *pdoc, Node *node);
62 static char *s_jhtml_end_font_tag (void *pdoc, Node *node);
63 static char *s_jhtml_start_form_tag (void *pdoc, Node *node);
64 static char *s_jhtml_end_form_tag (void *pdoc, Node *node);
65 static char *s_jhtml_start_input_tag (void *pdoc, Node *node);
66 static char *s_jhtml_end_input_tag (void *pdoc, Node *node);
67 static char *s_jhtml_start_center_tag (void *pdoc, Node *node);
68 static char *s_jhtml_end_center_tag (void *pdoc, Node *node);
69 static char *s_jhtml_start_hr_tag (void *pdoc, Node *node);
70 static char *s_jhtml_end_hr_tag (void *pdoc, Node *node);
71 static char *s_jhtml_start_img_tag (void *pdoc, Node *node);
72 static char *s_jhtml_end_img_tag (void *pdoc, Node *node);
73 static char *s_jhtml_start_select_tag (void *pdoc, Node *node);
74 static char *s_jhtml_end_select_tag (void *pdoc, Node *node);
75 static char *s_jhtml_start_option_tag (void *pdoc, Node *node);
76 static char *s_jhtml_end_option_tag (void *pdoc, Node *node);
77 static char *s_jhtml_start_div_tag (void *pdoc, Node *node);
78 static char *s_jhtml_end_div_tag (void *pdoc, Node *node);
79 static char *s_jhtml_start_textarea_tag (void *pdoc, Node *node);
80 static char *s_jhtml_end_textarea_tag (void *pdoc, Node *node);
81 static char *s_jhtml_start_b_tag (void *pdoc, Node *node);
82 static char *s_jhtml_end_b_tag (void *pdoc, Node *node);
83 static char *s_jhtml_chxjif_tag (void *pdoc, Node *node);
84 static char *s_jhtml_text_tag (void *pdoc, Node *node);
85 static char *s_jhtml_start_blockquote_tag(void *pdoc, Node *node);
86 static char *s_jhtml_end_blockquote_tag (void *pdoc, Node *node);
87 static char *s_jhtml_start_dir_tag (void *pdoc, Node *node);
88 static char *s_jhtml_end_dir_tag (void *pdoc, Node *node);
90 static void s_init_jhtml(jhtml_t *jhtml, Doc *doc, request_rec *r, device_table *spec);
92 static int s_jhtml_search_emoji(jhtml_t *jhtml, char *txt, char **rslt);
94 static char *chxj_istyle_to_mode(request_rec *r, const char *s);
98 tag_handler jhtml_handler[] = {
101 s_jhtml_start_html_tag,
102 s_jhtml_end_html_tag,
106 s_jhtml_start_meta_tag,
107 s_jhtml_end_meta_tag,
111 s_jhtml_start_textarea_tag,
112 s_jhtml_end_textarea_tag,
121 s_jhtml_start_pre_tag,
126 s_jhtml_start_ul_tag,
131 s_jhtml_start_li_tag,
136 s_jhtml_start_ol_tag,
171 s_jhtml_start_head_tag,
172 s_jhtml_end_head_tag,
176 s_jhtml_start_title_tag,
177 s_jhtml_end_title_tag,
181 s_jhtml_start_base_tag,
182 s_jhtml_end_base_tag,
186 s_jhtml_start_body_tag,
187 s_jhtml_end_body_tag,
196 s_jhtml_start_br_tag,
206 s_jhtml_start_tr_tag,
221 s_jhtml_start_font_tag,
222 s_jhtml_end_font_tag,
226 s_jhtml_start_form_tag,
227 s_jhtml_end_form_tag,
231 s_jhtml_start_input_tag,
232 s_jhtml_end_input_tag,
236 s_jhtml_start_center_tag,
237 s_jhtml_end_center_tag,
241 s_jhtml_start_hr_tag,
246 s_jhtml_start_img_tag,
251 s_jhtml_start_select_tag,
252 s_jhtml_end_select_tag,
256 s_jhtml_start_option_tag,
257 s_jhtml_end_option_tag,
261 s_jhtml_start_div_tag,
326 s_jhtml_start_blockquote_tag,
327 s_jhtml_end_blockquote_tag,
331 s_jhtml_start_dir_tag,
368 * converts from CHTML5.0 to JHTML.
370 * @param r [i] Requet_rec is appointed.
371 * @param spec [i] The result of the device specification processing which
372 * was done in advance is appointed.
373 * @param src [i] The character string before the converting is appointed.
374 * @return The character string after the converting is returned.
383 chxjconvrule_entry *entryp,
394 /*--------------------------------------------------------------------------*/
396 /*--------------------------------------------------------------------------*/
398 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
400 DBG(r,"I found qrcode xml");
403 DBG(r,"not found qrcode xml");
405 /*--------------------------------------------------------------------------*/
406 /* The CHTML structure is initialized. */
407 /*--------------------------------------------------------------------------*/
408 s_init_jhtml(&jhtml, &doc, r, spec);
410 jhtml.entryp = entryp;
411 jhtml.cookie = cookie;
413 chxj_set_content_type(r, "text/html; charset=Windows-31J");
415 /*--------------------------------------------------------------------------*/
416 /* The character string of the input is analyzed. */
417 /*--------------------------------------------------------------------------*/
418 qs_init_malloc(&doc);
419 qs_init_root_node(&doc);
421 ss = apr_pcalloc(r->pool, srclen + 1);
423 memset(ss, 0, srclen + 1);
424 memcpy(ss, src, srclen);
427 chxj_dump_out("[src] CHTML -> JHTML", ss, srclen);
430 qs_parse_string(&doc,ss,strlen(ss));
432 chxj_buffered_write_init(r->pool, &doc.buf);
433 /*--------------------------------------------------------------------------*/
434 /* It converts it from CHTML to JHTML. */
435 /*--------------------------------------------------------------------------*/
436 chxj_node_exchange(spec,r,(void*)&jhtml, &doc, qs_get_root(&doc), 0);
437 jhtml.out = chxj_buffered_write_flush(jhtml.out, &doc.buf);
438 dst = apr_pstrdup(r->pool, jhtml.out);
439 chxj_buffered_write_terminate(&doc.buf);
442 qs_all_free(&doc,QX_LOGMARK);
445 return apr_pstrdup(r->pool,ss);
448 dst = apr_psprintf(r->pool, "\n");
450 *dstlen = strlen(dst);
453 chxj_dump_out("[dst] CHTML -> JHTML", dst, *dstlen);
461 * The CHTML structure is initialized.
463 * @param jhtml [i/o] The pointer to the JHTML structure that wants to be
464 * initialized is specified.
465 * @param doc [i] The Doc structure that should be set to the initialized
466 * JHTML structure is specified.
467 * @param r [i] To use POOL, the pointer to request_rec is specified.
468 * @param spec [i] The pointer to the device_table
471 s_init_jhtml(jhtml_t* jhtml, Doc* doc, request_rec* r, device_table* spec)
473 memset(doc, 0, sizeof(Doc));
474 memset(jhtml, 0, sizeof(jhtml_t));
479 jhtml->out = qs_alloc_zero_byte_string(r);
480 jhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
481 jhtml->doc->parse_mode = PARSE_MODE_CHTML;
486 * Corresponding EMOJI to a current character-code is retrieved.
487 * The substitution character string is stored in the rslt pointer if agreeing.
489 * @param jhtml [i] The pointer to the CHTML structure is specified.
490 * @param txt [i] The character string to want to examine whether it is
491 * EMOJI is specified.
492 * @param rslt [o] The pointer to the pointer that stores the result is
494 * @return When corresponding EMOJI exists, it returns it excluding 0.
497 s_jhtml_search_emoji(jhtml_t *jhtml, char *txt, char **rslt)
509 if (! spec) DBG(r,"spec is NULL");
511 for (ee = jhtml->conf->emoji;
515 unsigned char hex1byte;
516 unsigned char hex2byte;
519 DBG(r,"emoji->imode is NULL");
523 hex1byte = ee->imode->hex1byte & 0xff;
524 hex2byte = ee->imode->hex2byte & 0xff;
526 if (ee->imode->string
527 && strlen(ee->imode->string) > 0
528 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
529 if (spec == NULL || spec->emoji_type == NULL) {
530 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
531 return strlen(ee->imode->string);
538 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
539 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
540 if (spec == NULL || spec->emoji_type == NULL) {
541 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
554 * It is a handler who processes the HTML tag.
556 * @param pdoc [i/o] The pointer to the CHTML structure at the output
557 * destination is specified.
558 * @param node [i] The HTML tag node is specified.
559 * @return The conversion result is returned.
562 s_jhtml_start_html_tag(void *pdoc, Node *UNUSED(node))
569 jhtml = GET_JHTML(pdoc);
572 DBG(r, "start s_jhtml_start_html_tag()");
574 /*--------------------------------------------------------------------------*/
576 /*--------------------------------------------------------------------------*/
579 DBG(r, "end s_jhtml_start_html_tag()");
586 * It is a handler who processes the HTML tag.
588 * @param pdoc [i/o] The pointer to the CHTML structure at the output
589 * destination is specified.
590 * @param node [i] The HTML tag node is specified.
591 * @return The conversion result is returned.
594 s_jhtml_end_html_tag(void *pdoc, Node *UNUSED(child))
596 jhtml_t *jhtml = GET_JHTML(pdoc);
597 Doc *doc = jhtml->doc;
606 * It is a handler who processes the META tag.
608 * @param pdoc [i/o] The pointer to the CHTML structure at the output
609 * destination is specified.
610 * @param node [i] The META tag node is specified.
611 * @return The conversion result is returned.
614 s_jhtml_start_meta_tag(void *pdoc, Node *node)
620 int content_type_flag;
623 jhtml = GET_JHTML(pdoc);
627 content_type_flag = 0;
630 /*--------------------------------------------------------------------------*/
632 /*--------------------------------------------------------------------------*/
633 for (attr = qs_get_attr(doc,node);
635 attr = qs_get_next_attr(doc,attr)) {
636 char *name = qs_get_attr_name(doc,attr);
637 char *value = qs_get_attr_value(doc,attr);
641 if (strcasecmp(name, "http-equiv") == 0) {
642 /*----------------------------------------------------------------------*/
644 /*----------------------------------------------------------------------*/
645 W_L(" http-equiv=\"");
648 if (STRCASEEQ('c','C',"content-type",value)) {
649 content_type_flag = 1;
651 if (STRCASEEQ('r','R',"refresh",value)) {
659 if (strcasecmp(name, "content") == 0) {
660 /*----------------------------------------------------------------------*/
662 /*----------------------------------------------------------------------*/
663 if (content_type_flag) {
667 W_L("text/html; charset=Windows-31J");
676 buf = apr_pstrdup(r->pool, value);
678 url = strchr(buf, ';');
680 sec = apr_pstrdup(r->pool, buf);
683 url = chxj_encoding_parameter(r, url);
684 url = chxj_add_cookie_parameter(r, url, jhtml->cookie);
714 * It is a handler who processes the META tag.
716 * @param pdoc [i/o] The pointer to the CHTML structure at the output
717 * destination is specified.
718 * @param node [i] The META tag node is specified.
719 * @return The conversion result is returned.
722 s_jhtml_end_meta_tag(void *pdoc, Node *UNUSED(child))
724 jhtml_t *jhtml = GET_JHTML(pdoc);
731 * It is a handler who processes the HEAD tag.
733 * @param pdoc [i/o] The pointer to the CHTML structure at the output
734 * destination is specified.
735 * @param node [i] The HEAD tag node is specified.
736 * @return The conversion result is returned.
739 s_jhtml_start_head_tag(void *pdoc, Node *UNUSED(node))
745 jhtml = GET_JHTML(pdoc);
755 * It is a handler who processes the HEAD tag.
757 * @param pdoc [i/o] The pointer to the CHTML structure at the output
758 * destination is specified.
759 * @param node [i] The HEAD tag node is specified.
760 * @return The conversion result is returned.
763 s_jhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
769 jhtml = GET_JHTML(pdoc);
779 * It is a handler who processes the TITLE tag.
781 * @param pdoc [i/o] The pointer to the CHTML structure at the output
782 * destination is specified.
783 * @param node [i] The TITLE tag node is specified.
784 * @return The conversion result is returned.
787 s_jhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
793 jhtml = GET_JHTML(pdoc);
803 * It is a handler who processes the TITLE tag.
805 * @param pdoc [i/o] The pointer to the CHTML structure at the output
806 * destination is specified.
807 * @param node [i] The TITLE tag node is specified.
808 * @return The conversion result is returned.
811 s_jhtml_end_title_tag(void *pdoc, Node *UNUSED(child))
817 jhtml = GET_JHTML(pdoc);
827 * It is a handler who processes the BASE tag.
829 * @param pdoc [i/o] The pointer to the CHTML structure at the output
830 * destination is specified.
831 * @param node [i] The BASE tag node is specified.
832 * @return The conversion result is returned.
835 s_jhtml_start_base_tag(void *pdoc, Node *node)
842 jhtml = GET_JHTML(pdoc);
847 /*--------------------------------------------------------------------------*/
849 /*--------------------------------------------------------------------------*/
850 for (attr = qs_get_attr(doc,node);
852 attr = qs_get_next_attr(doc,attr)) {
853 char *name = qs_get_attr_name(doc,attr);
854 char *value = qs_get_attr_value(doc,attr);
855 if (STRCASEEQ('h','H',"href",name)) {
867 * It is a handler who processes the BASE tag.
869 * @param pdoc [i/o] The pointer to the CHTML structure at the output
870 * destination is specified.
871 * @param node [i] The BASE tag node is specified.
872 * @return The conversion result is returned.
875 s_jhtml_end_base_tag(void *pdoc, Node *UNUSED(child))
877 jhtml_t *jhtml = GET_JHTML(pdoc);
883 * It is a handler who processes the BODY tag.
885 * @param pdoc [i/o] The pointer to the CHTML structure at the output
886 * destination is specified.
887 * @param node [i] The BODY tag node is specified.
888 * @return The conversion result is returned.
891 s_jhtml_start_body_tag(void *pdoc, Node *node)
898 jhtml = GET_JHTML(pdoc);
903 /*--------------------------------------------------------------------------*/
905 /*--------------------------------------------------------------------------*/
906 for (attr = qs_get_attr(doc,node);
908 attr = qs_get_next_attr(doc,attr)) {
909 char *name = qs_get_attr_name(doc,attr);
910 char *value = qs_get_attr_value(doc,attr);
911 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
912 /*----------------------------------------------------------------------*/
914 /*----------------------------------------------------------------------*/
919 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
920 /*----------------------------------------------------------------------*/
922 /*----------------------------------------------------------------------*/
927 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
928 /*----------------------------------------------------------------------*/
930 /*----------------------------------------------------------------------*/
935 else if (STRCASEEQ('a','A',"alink",name)) {
936 /*----------------------------------------------------------------------*/
938 /*----------------------------------------------------------------------*/
941 else if (STRCASEEQ('v','V',"vlink",name) && value && *value) {
942 /*----------------------------------------------------------------------*/
944 /*----------------------------------------------------------------------*/
956 * It is a handler who processes the BODY tag.
958 * @param pdoc [i/o] The pointer to the CHTML structure at the output
959 * destination is specified.
960 * @param node [i] The BODY tag node is specified.
961 * @return The conversion result is returned.
964 s_jhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
970 jhtml = GET_JHTML(pdoc);
980 * It is a handler who processes the A tag.
982 * @param pdoc [i/o] The pointer to the CHTML structure at the output
983 * destination is specified.
984 * @param node [i] The A tag node is specified.
985 * @return The conversion result is returned.
988 s_jhtml_start_a_tag(void *pdoc, Node *node)
995 jhtml = GET_JHTML(pdoc);
1000 /*--------------------------------------------------------------------------*/
1001 /* Get Attributes */
1002 /*--------------------------------------------------------------------------*/
1003 for (attr = qs_get_attr(doc,node);
1005 attr = qs_get_next_attr(doc,attr)) {
1006 char *name = qs_get_attr_name(doc,attr);
1007 char *value = qs_get_attr_value(doc,attr);
1008 if (STRCASEEQ('n','N',"name",name)) {
1009 /*----------------------------------------------------------------------*/
1011 /*----------------------------------------------------------------------*/
1016 else if (STRCASEEQ('h','H',"href",name)) {
1017 /*----------------------------------------------------------------------*/
1019 /*----------------------------------------------------------------------*/
1020 value = chxj_encoding_parameter(r, value);
1021 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
1026 else if (STRCASEEQ('a','A',"accesskey",name)) {
1027 /*----------------------------------------------------------------------*/
1029 /*----------------------------------------------------------------------*/
1030 W_L(" accesskey=\"");
1034 else if (STRCASEEQ('c','C',"cti",name)) {
1035 /*----------------------------------------------------------------------*/
1037 /*----------------------------------------------------------------------*/
1042 else if (STRCASEEQ('i','I',"ijam",name)) {
1043 /*----------------------------------------------------------------------*/
1045 /*----------------------------------------------------------------------*/
1048 else if (STRCASEEQ('u','U',"utn",name)) {
1049 /*----------------------------------------------------------------------*/
1051 /* It is special only for CHTML. */
1052 /*----------------------------------------------------------------------*/
1055 else if (STRCASEEQ('t','T',"telbook",name)) {
1056 /*----------------------------------------------------------------------*/
1058 /*----------------------------------------------------------------------*/
1061 else if (STRCASEEQ('k','K',"kana",name)) {
1062 /*----------------------------------------------------------------------*/
1064 /*----------------------------------------------------------------------*/
1067 else if (STRCASEEQ('e','E',"email",name)) {
1068 /*----------------------------------------------------------------------*/
1070 /*----------------------------------------------------------------------*/
1073 else if (STRCASEEQ('i','I',"ista",name)) {
1074 /*----------------------------------------------------------------------*/
1076 /*----------------------------------------------------------------------*/
1079 else if (STRCASEEQ('i','I',"ilet",name)) {
1080 /*----------------------------------------------------------------------*/
1082 /*----------------------------------------------------------------------*/
1085 else if (STRCASEEQ('i','I',"iswf",name)) {
1086 /*----------------------------------------------------------------------*/
1088 /*----------------------------------------------------------------------*/
1091 else if (STRCASEEQ('i','I',"irst",name)) {
1092 /*----------------------------------------------------------------------*/
1094 /*----------------------------------------------------------------------*/
1104 * It is a handler who processes the A tag.
1106 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1107 * destination is specified.
1108 * @param node [i] The A tag node is specified.
1109 * @return The conversion result is returned.
1112 s_jhtml_end_a_tag(void *pdoc, Node *UNUSED(child))
1118 jhtml = GET_JHTML(pdoc);
1128 * It is a handler who processes the BR tag.
1130 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1131 * destination is specified.
1132 * @param node [i] The BR tag node is specified.
1133 * @return The conversion result is returned.
1136 s_jhtml_start_br_tag(void *pdoc, Node *node)
1143 jhtml = GET_JHTML(pdoc);
1148 /*--------------------------------------------------------------------------*/
1149 /* Get Attributes */
1150 /*--------------------------------------------------------------------------*/
1151 for (attr = qs_get_attr(doc,node);
1153 attr = qs_get_next_attr(doc,attr)) {
1154 char *name = qs_get_attr_name(doc,attr);
1155 char *value = qs_get_attr_value(doc,attr);
1156 if (STRCASEEQ('c','C',"clear",name)) {
1157 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1170 * It is a handler who processes the BR tag.
1172 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1173 * destination is specified.
1174 * @param node [i] The BR tag node is specified.
1175 * @return The conversion result is returned.
1178 s_jhtml_end_br_tag(void *pdoc, Node *UNUSED(child))
1180 jhtml_t *jhtml = GET_JHTML(pdoc);
1186 * It is a handler who processes the TR tag.
1188 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1189 * destination is specified.
1190 * @param node [i] The TR tag node is specified.
1191 * @return The conversion result is returned.
1194 s_jhtml_start_tr_tag(void *pdoc, Node *UNUSED(node))
1200 jhtml = GET_JHTML(pdoc);
1210 * It is a handler who processes the TR tag.
1212 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1213 * destination is specified.
1214 * @param node [i] The TR tag node is specified.
1215 * @return The conversion result is returned.
1218 s_jhtml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1220 jhtml_t *jhtml = GET_JHTML(pdoc);
1226 * It is a handler who processes the FONT tag.
1228 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1229 * destination is specified.
1230 * @param node [i] The FONT tag node is specified.
1231 * @return The conversion result is returned.
1234 s_jhtml_start_font_tag(void *pdoc, Node *node)
1241 jhtml = GET_JHTML(pdoc);
1246 /*--------------------------------------------------------------------------*/
1247 /* Get Attributes */
1248 /*--------------------------------------------------------------------------*/
1249 for (attr = qs_get_attr(doc,node);
1251 attr = qs_get_next_attr(doc,attr)) {
1252 char *name = qs_get_attr_name(doc,attr);
1253 char *value = qs_get_attr_value(doc,attr);
1254 if (STRCASEEQ('c','C',"color",name)) {
1259 else if (STRCASEEQ('s','S',"size",name)) {
1260 /*----------------------------------------------------------------------*/
1262 /*----------------------------------------------------------------------*/
1272 * It is a handler who processes the FONT tag.
1274 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1275 * destination is specified.
1276 * @param node [i] The FONT tag node is specified.
1277 * @return The conversion result is returned.
1280 s_jhtml_end_font_tag(void *pdoc, Node *UNUSED(child))
1286 jhtml = GET_JHTML(pdoc);
1296 * It is a handler who processes the FORM tag.
1298 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1299 * destination is specified.
1300 * @param node [i] The FORM tag node is specified.
1301 * @return The conversion result is returned.
1304 s_jhtml_start_form_tag(void *pdoc, Node *node)
1311 jhtml = GET_JHTML(pdoc);
1315 /*--------------------------------------------------------------------------*/
1316 /* Get Attributes */
1317 /*--------------------------------------------------------------------------*/
1318 for (attr = qs_get_attr(doc,node);
1320 attr = qs_get_next_attr(doc,attr)) {
1321 char *name = qs_get_attr_name(doc,attr);
1322 char *value = qs_get_attr_value(doc,attr);
1323 if (STRCASEEQ('a','A',"action",name)) {
1324 /*----------------------------------------------------------------------*/
1326 /*----------------------------------------------------------------------*/
1331 else if (STRCASEEQ('m','M',"method",name)) {
1332 /*----------------------------------------------------------------------*/
1334 /*----------------------------------------------------------------------*/
1339 else if (STRCASEEQ('u','U',"utn",name)) {
1340 /*----------------------------------------------------------------------*/
1342 /* It is special only for CHTML. */
1343 /*----------------------------------------------------------------------*/
1348 if (jhtml->cookie && jhtml->cookie->cookie_id) {
1349 char *vv = apr_psprintf(doc->buf.pool, "%s<input type='hidden' name='%s' value='%s'>",
1352 chxj_url_decode(r, jhtml->cookie->cookie_id));
1360 * It is a handler who processes the FORM tag.
1362 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1363 * destination is specified.
1364 * @param node [i] The FORM tag node is specified.
1365 * @return The conversion result is returned.
1368 s_jhtml_end_form_tag(void *pdoc, Node *UNUSED(child))
1370 jhtml_t *jhtml = GET_JHTML(pdoc);
1371 Doc *doc = jhtml->doc;
1378 * It is a handler who processes the INPUT tag.
1380 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1381 * destination is specified.
1382 * @param node [i] The INPUT tag node is specified.
1383 * @return The conversion result is returned.
1386 s_jhtml_start_input_tag(void *pdoc, Node *node)
1400 jhtml = GET_JHTML(pdoc);
1413 /*--------------------------------------------------------------------------*/
1414 /* Get Attributes */
1415 /*--------------------------------------------------------------------------*/
1416 type = qs_get_type_attr(doc, node, r);
1417 name = qs_get_name_attr(doc, node, r);
1418 value = qs_get_value_attr(doc,node,r);
1419 istyle = qs_get_istyle_attr(doc,node,r);
1420 max_length = qs_get_maxlength_attr(doc,node,r);
1421 checked = qs_get_checked_attr(doc,node,r);
1422 accesskey = qs_get_accesskey_attr(doc, node, r);
1423 size = qs_get_size_attr(doc, node, r);
1446 W_L(" accesskey=\"");
1451 /*------------------------------------------------------------------------*/
1453 /*------------------------------------------------------------------------*/
1454 if (STRCASEEQ('p','P',"password", type) && ! jhtml->entryp->pc_flag ) {
1460 char *vv = chxj_istyle_to_mode(r,istyle);
1466 else if (istyle == NULL && type != NULL && STRCASEEQ('p','P',"password",type)) {
1471 /*--------------------------------------------------------------------------*/
1472 /* The figure is default for the password. */
1473 /*--------------------------------------------------------------------------*/
1475 W_L(" maxlength=\"");
1489 * It is a handler who processes the INPUT tag.
1491 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1492 * destination is specified.
1493 * @param node [i] The INPUT tag node is specified.
1494 * @return The conversion result is returned.
1497 s_jhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
1499 jhtml_t *jhtml = GET_JHTML(pdoc);
1505 * It is a handler who processes the CENTER tag.
1507 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1508 * destination is specified.
1509 * @param node [i] The CENTER tag node is specified.
1510 * @return The conversion result is returned.
1513 s_jhtml_start_center_tag(void *pdoc, Node *UNUSED(node))
1515 jhtml_t *jhtml = GET_JHTML(pdoc);
1516 Doc *doc = jhtml->doc;
1523 * It is a handler who processes the CENTER tag.
1525 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1526 * destination is specified.
1527 * @param node [i] The CENTER tag node is specified.
1528 * @return The conversion result is returned.
1531 s_jhtml_end_center_tag(void *pdoc, Node *UNUSED(child))
1537 jhtml = GET_JHTML(pdoc);
1547 * It is a handler who processes the li tag.
1549 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1550 * destination is specified.
1551 * @param node [i] The li tag node is specified.
1552 * @return The conversion result is returned.
1555 s_jhtml_start_li_tag(void *pdoc, Node *UNUSED(node))
1561 jhtml = GET_JHTML(pdoc);
1571 * It is a handler who processes the li tag.
1573 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1574 * destination is specified.
1575 * @param node [i] The li tag node is specified.
1576 * @return The conversion result is returned.
1579 s_jhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
1585 jhtml = GET_JHTML(pdoc);
1595 * It is a handler who processes the OL tag.
1597 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1598 * destination is specified.
1599 * @param node [i] The OL tag node is specified.
1600 * @return The conversion result is returned.
1603 s_jhtml_start_ol_tag(void *pdoc, Node *UNUSED(node))
1609 jhtml = GET_JHTML(pdoc);
1619 * It is a handler who processes the OL tag.
1621 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1622 * destination is specified.
1623 * @param node [i] The OL tag node is specified.
1624 * @return The conversion result is returned.
1627 s_jhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
1633 jhtml = GET_JHTML(pdoc);
1643 * It is a handler who processes the P tag.
1645 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1646 * destination is specified.
1647 * @param node [i] The P tag node is specified.
1648 * @return The conversion result is returned.
1651 s_jhtml_start_p_tag(void *pdoc, Node *UNUSED(node))
1657 jhtml = GET_JHTML(pdoc);
1667 * It is a handler who processes the P tag.
1669 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1670 * destination is specified.
1671 * @param node [i] The P tag node is specified.
1672 * @return The conversion result is returned.
1675 s_jhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
1677 jhtml_t *jhtml = GET_JHTML(pdoc);
1678 Doc *doc = jhtml->doc;
1686 * It is a handler who processes the PRE tag.
1688 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1689 * destination is specified.
1690 * @param node [i] The PRE tag node is specified.
1691 * @return The conversion result is returned.
1694 s_jhtml_start_pre_tag(void *pdoc, Node *UNUSED(node))
1696 jhtml_t *jhtml = GET_JHTML(pdoc);
1697 Doc *doc = jhtml->doc;
1706 * It is a handler who processes the PRE tag.
1708 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1709 * destination is specified.
1710 * @param node [i] The PRE tag node is specified.
1711 * @return The conversion result is returned.
1714 s_jhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
1716 jhtml_t *jhtml = GET_JHTML(pdoc);
1717 Doc *doc = jhtml->doc;
1727 * It is a handler who processes the UL tag.
1729 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1730 * destination is specified.
1731 * @param node [i] The UL tag node is specified.
1732 * @return The conversion result is returned.
1735 s_jhtml_start_ul_tag(void *pdoc, Node *UNUSED(node))
1737 jhtml_t *jhtml = GET_JHTML(pdoc);
1738 Doc *doc = jhtml->doc;
1746 * It is a handler who processes the UL tag.
1748 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1749 * destination is specified.
1750 * @param node [i] The UL tag node is specified.
1751 * @return The conversion result is returned.
1754 s_jhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
1756 jhtml_t *jhtml = GET_JHTML(pdoc);
1757 Doc *doc = jhtml->doc;
1765 * It is a handler who processes the HR tag.
1767 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1768 * destination is specified.
1769 * @param node [i] The HR tag node is specified.
1770 * @return The conversion result is returned.
1773 s_jhtml_start_hr_tag(void *pdoc, Node *node)
1775 jhtml_t *jhtml = GET_JHTML(pdoc);
1776 Doc *doc = jhtml->doc;
1780 for (attr = qs_get_attr(doc,node);
1782 attr = qs_get_next_attr(doc,attr)) {
1783 char *name = qs_get_attr_name(doc,attr);
1784 char *value = qs_get_attr_value(doc,attr);
1785 if (STRCASEEQ('a','A',"align",name)) {
1786 /*----------------------------------------------------------------------*/
1788 /*----------------------------------------------------------------------*/
1793 else if (STRCASEEQ('s','S',"size",name)) {
1794 /*----------------------------------------------------------------------*/
1796 /*----------------------------------------------------------------------*/
1801 else if (STRCASEEQ('w','W',"width",name)) {
1802 /*----------------------------------------------------------------------*/
1804 /*----------------------------------------------------------------------*/
1809 else if (STRCASEEQ('n','N',"noshade",name)) {
1810 /*----------------------------------------------------------------------*/
1812 /*----------------------------------------------------------------------*/
1815 else if (STRCASEEQ('c','C',"color",name)) {
1816 /*----------------------------------------------------------------------*/
1818 /*----------------------------------------------------------------------*/
1828 * It is a handler who processes the HR tag.
1830 * @param jhtml [i/o] The pointer to the CHTML structure at the output
1831 * destination is specified.
1832 * @param node [i] The HR tag node is specified.
1833 * @return The conversion result is returned.
1836 s_jhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
1838 jhtml_t *jhtml = GET_JHTML(pdoc);
1844 * It is a handler who processes the IMG tag.
1846 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1847 * destination is specified.
1848 * @param node [i] The IMG tag node is specified.
1849 * @return The conversion result is returned.
1852 s_jhtml_start_img_tag(void *pdoc, Node *node)
1854 jhtml_t *jhtml = GET_JHTML(pdoc);
1855 Doc *doc = jhtml->doc;
1856 request_rec *r = doc->r;
1858 #ifndef IMG_NOT_CONVERT_FILENAME
1859 device_table *spec = jhtml->spec;
1863 /*--------------------------------------------------------------------------*/
1864 /* Get Attributes */
1865 /*--------------------------------------------------------------------------*/
1866 for (attr = qs_get_attr(doc,node);
1868 attr = qs_get_next_attr(doc,attr)) {
1869 char *name = qs_get_attr_name(doc,attr);
1870 char *value = qs_get_attr_value(doc,attr);
1871 if (STRCASEEQ('s','S',"src",name)) {
1872 /*----------------------------------------------------------------------*/
1874 /*----------------------------------------------------------------------*/
1875 #ifdef IMG_NOT_CONVERT_FILENAME
1876 value = chxj_encoding_parameter(r, value);
1877 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
1879 value = apr_psprintf(r->pool,
1882 (strchr(value, '?')) ? '&' : '?',
1883 CHXJ_COOKIE_NOUPDATE_PARAM);
1889 value = chxj_img_conv(r, spec, value);
1890 value = chxj_encoding_parameter(r, value);
1891 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
1893 value = apr_psprintf(r->pool,
1896 (strchr(value, '?')) ? '&' : '?',
1897 CHXJ_COOKIE_NOUPDATE_PARAM);
1904 else if (STRCASEEQ('a','A',"align",name)) {
1905 /*----------------------------------------------------------------------*/
1907 /*----------------------------------------------------------------------*/
1912 else if (STRCASEEQ('w','W',"width",name)) {
1913 /*----------------------------------------------------------------------*/
1915 /*----------------------------------------------------------------------*/
1920 else if (STRCASEEQ('h','H',"height",name)) {
1921 /*----------------------------------------------------------------------*/
1923 /*----------------------------------------------------------------------*/
1928 else if (STRCASEEQ('h','H',"hspace",name)) {
1929 /*----------------------------------------------------------------------*/
1931 /*----------------------------------------------------------------------*/
1936 else if (STRCASEEQ('v','V',"vspace",name)) {
1937 /*----------------------------------------------------------------------*/
1939 /*----------------------------------------------------------------------*/
1944 else if (STRCASEEQ('a','A',"alt",name)) {
1945 /*----------------------------------------------------------------------*/
1947 /*----------------------------------------------------------------------*/
1952 else if (STRCASEEQ('a','A',"align",name)) {
1953 /*----------------------------------------------------------------------*/
1955 /*----------------------------------------------------------------------*/
1965 * It is a handler who processes the IMG tag.
1967 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1968 * destination is specified.
1969 * @param node [i] The IMG tag node is specified.
1970 * @return The conversion result is returned.
1973 s_jhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
1975 jhtml_t *jhtml = GET_JHTML(pdoc);
1981 * It is a handler who processes the SELECT tag.
1983 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1984 * destination is specified.
1985 * @param node [i] The SELECT tag node is specified.
1986 * @return The conversion result is returned.
1989 s_jhtml_start_select_tag(void *pdoc, Node *child)
1991 jhtml_t *jhtml = GET_JHTML(pdoc);
1992 Doc *doc = jhtml->doc;
1999 for (attr = qs_get_attr(doc,child);
2001 attr = qs_get_next_attr(doc,attr)) {
2002 char *nm = qs_get_attr_name(doc,attr);
2003 char *val = qs_get_attr_value(doc,attr);
2004 if (STRCASEEQ('s','S',"size",nm)) {
2005 /*----------------------------------------------------------------------*/
2006 /* CHTML 1.0 version 2.0 */
2007 /*----------------------------------------------------------------------*/
2008 size = apr_pstrdup(doc->buf.pool, val);
2010 else if (STRCASEEQ('n','N',"name",nm)) {
2011 /*----------------------------------------------------------------------*/
2012 /* CHTML 1.0 version 2.0 */
2013 /*----------------------------------------------------------------------*/
2014 name = apr_pstrdup(doc->buf.pool, val);
2016 else if (STRCASEEQ('m','M',"multiple",nm)) {
2017 /*----------------------------------------------------------------------*/
2018 /* CHTML 1.0 version 2.0 */
2019 /*----------------------------------------------------------------------*/
2040 * It is a handler who processes the SELECT tag.
2042 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2043 * destination is specified.
2044 * @param node [i] The SELECT tag node is specified.
2045 * @return The conversion result is returned.
2048 s_jhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
2050 jhtml_t *jhtml = GET_JHTML(pdoc);
2051 Doc *doc = jhtml->doc;
2058 * It is a handler who processes the OPTION tag.
2060 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2061 * destination is specified.
2062 * @param node [i] The OPTION tag node is specified.
2063 * @return The conversion result is returned.
2066 s_jhtml_start_option_tag(void *pdoc, Node *child)
2068 jhtml_t *jhtml = GET_JHTML(pdoc);
2069 Doc *doc = jhtml->doc;
2072 char *selected = NULL;
2076 for (attr = qs_get_attr(doc,child);
2078 attr = qs_get_next_attr(doc,attr)) {
2079 char *nm = qs_get_attr_name(doc,attr);
2080 char *val = qs_get_attr_value(doc,attr);
2081 if (STRCASEEQ('s','S',"selected",nm)) {
2082 /*----------------------------------------------------------------------*/
2083 /* CHTML 1.0 version 2.0 */
2084 /*----------------------------------------------------------------------*/
2085 selected = apr_pstrdup(doc->buf.pool, val);
2087 else if (STRCASEEQ('v','V',"value",nm)) {
2088 /*----------------------------------------------------------------------*/
2089 /* CHTML 1.0 version 2.0 */
2090 /*----------------------------------------------------------------------*/
2091 value = apr_pstrdup(doc->buf.pool, val);
2113 * It is a handler who processes the OPTION tag.
2115 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2116 * destination is specified.
2117 * @param node [i] The OPTION tag node is specified.
2118 * @return The conversion result is returned.
2121 s_jhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
2123 jhtml_t *jhtml = GET_JHTML(pdoc);
2130 * It is a handler who processes the DIV tag.
2132 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2133 * destination is specified.
2134 * @param node [i] The DIV tag node is specified.
2135 * @return The conversion result is returned.
2138 s_jhtml_start_div_tag(void *pdoc, Node *child)
2146 jhtml = GET_JHTML(pdoc);
2153 for (attr = qs_get_attr(doc,child);
2155 attr = qs_get_next_attr(doc,attr)) {
2156 char *nm = qs_get_attr_name(doc,attr);
2157 char *val = qs_get_attr_value(doc,attr);
2158 if (STRCASEEQ('a','A',"align",nm)) {
2159 /*----------------------------------------------------------------------*/
2160 /* CHTML 1.0 (W3C version 3.2) */
2161 /*----------------------------------------------------------------------*/
2162 align = apr_pstrdup(doc->buf.pool, val);
2177 * It is a handler who processes the DIV tag.
2179 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2180 * destination is specified.
2181 * @param node [i] The DIV tag node is specified.
2182 * @return The conversion result is returned.
2185 s_jhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
2191 jhtml = GET_JHTML(pdoc);
2201 chxj_istyle_to_mode(request_rec *r, const char *s)
2207 case '1': return apr_psprintf(r->pool, "hiragana");
2208 case '2': return apr_psprintf(r->pool, "hankakukana");
2209 case '3': return apr_psprintf(r->pool, "alphabet");
2210 case '4': return apr_psprintf(r->pool, "numeric");
2212 tmp = apr_palloc(r->pool, 1);
2214 return apr_pstrdup(r->pool, tmp);
2218 tmp = apr_palloc(r->pool, 1);
2220 return apr_pstrdup(r->pool,tmp);
2225 s_jhtml_chxjif_tag(void *pdoc, Node *node)
2232 jhtml = GET_JHTML(pdoc);
2236 for (child = qs_get_child_node(doc, node);
2238 child = qs_get_next_node(doc, child)) {
2240 s_jhtml_chxjif_tag(jhtml, child);
2247 * It is a handler who processes the TEXTARE tag.
2249 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2250 * destination is specified.
2251 * @param node [i] The TEXTAREA tag node is specified.
2252 * @return The conversion result is returned.
2255 s_jhtml_start_textarea_tag(void* pdoc, Node* node)
2262 jhtml = GET_JHTML(pdoc);
2266 jhtml->textarea_flag++;
2268 for (attr = qs_get_attr(doc,node);
2270 attr = qs_get_next_attr(doc,attr)) {
2275 name = qs_get_attr_name(doc,attr);
2276 value = qs_get_attr_value(doc,attr);
2278 if (STRCASEEQ('n','N',"name",name)) {
2283 else if (STRCASEEQ('r','R',"rows",name)) {
2288 else if (STRCASEEQ('c','C',"cols",name)) {
2300 * It is a handler who processes the TEXTAREA tag.
2302 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2303 * destination is specified.
2304 * @param node [i] The TEXTAREA tag node is specified.
2305 * @return The conversion result is returned.
2308 s_jhtml_end_textarea_tag(void* pdoc, Node* UNUSED(child))
2314 jhtml = GET_JHTML(pdoc);
2318 W_L("</textarea>\r\n");
2319 jhtml->textarea_flag--;
2326 * It is a handler who processes the B tag.
2328 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2329 * destination is specified.
2330 * @param node [i] The B tag node is specified.
2331 * @return The conversion result is returned.
2334 s_jhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
2340 jhtml = GET_JHTML(pdoc);
2350 * It is a handler who processes the B tag.
2352 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2353 * destination is specified.
2354 * @param node [i] The B tag node is specified.
2355 * @return The conversion result is returned.
2358 s_jhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
2360 jhtml_t* jhtml = GET_JHTML(pdoc);
2361 Doc* doc = jhtml->doc;
2368 s_jhtml_text_tag(void* pdoc, Node* child)
2380 jhtml = GET_JHTML(pdoc);
2384 textval = qs_get_node_value(doc,child);
2385 textval = qs_trim_string(doc->buf.pool, textval);
2386 if (strlen(textval) == 0)
2389 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2390 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2392 tdst = qs_alloc_zero_byte_string(r);
2393 memset(one_byte, 0, sizeof(one_byte));
2396 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2398 int rtn = s_jhtml_search_emoji(jhtml, &textval[ii], &out);
2400 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2405 if (is_sjis_kanji(textval[ii])) {
2406 one_byte[0] = textval[ii+0];
2407 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2408 one_byte[0] = textval[ii+1];
2409 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2413 if (jhtml->pre_flag) {
2414 one_byte[0] = textval[ii+0];
2415 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2418 if (jhtml->textarea_flag) {
2419 one_byte[0] = textval[ii+0];
2420 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2423 if (textval[ii] != '\r' && textval[ii] != '\n') {
2424 one_byte[0] = textval[ii+0];
2425 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2435 * It is a handler who processes the BLOCKQUOTE tag.
2437 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2438 * destination is specified.
2439 * @param node [i] The BLOCKQUOTE tag node is specified.
2440 * @return The conversion result is returned.
2443 s_jhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2445 jhtml_t *jhtml = GET_JHTML(pdoc);
2446 Doc *doc = jhtml->doc;
2447 W_L("<blockquote>");
2453 * It is a handler who processes the BLOCKQUOTE tag.
2455 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2456 * destination is specified.
2457 * @param node [i] The BLOCKQUOTE tag node is specified.
2458 * @return The conversion result is returned.
2461 s_jhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2463 jhtml_t *jhtml = GET_JHTML(pdoc);
2464 Doc *doc = jhtml->doc;
2465 W_L("</blockquote>");
2471 * It is a handler who processes the DIR tag.
2473 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2474 * destination is specified.
2475 * @param node [i] The DIR tag node is specified.
2476 * @return The conversion result is returned.
2479 s_jhtml_start_dir_tag(void *pdoc, Node *UNUSED(child))
2481 jhtml_t *jhtml = GET_JHTML(pdoc);
2482 Doc *doc = jhtml->doc;
2489 * It is a handler who processes the DIR tag.
2491 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2492 * destination is specified.
2493 * @param node [i] The DIR tag node is specified.
2494 * @return The conversion result is returned.
2497 s_jhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
2499 jhtml_t *jhtml = GET_JHTML(pdoc);
2500 Doc *doc = jhtml->doc;