diff options
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 41 |
1 files changed, 37 insertions, 4 deletions
@@ -4399,6 +4399,14 @@ process_idattr(struct readbuffer *obuf, int cmd, struct parsed_tag *tag) envs[h_env->envc].indent = envs[h_env->envc - 1].indent; \ } +#define PUSH_ENV_NOINDENT(cmd) \ + if (++h_env->envc_real < h_env->nenv) { \ + ++h_env->envc; \ + envs[h_env->envc].env = cmd; \ + envs[h_env->envc].count = 0; \ + envs[h_env->envc].indent = envs[h_env->envc - 1].indent; \ + } + #define POP_ENV \ if (h_env->envc_real-- < h_env->nenv) \ h_env->envc--; @@ -4645,7 +4653,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) h_env->limit); POP_ENV; if (!(obuf->flag & RB_PREMODE) && - (h_env->envc == 0 || cmd == HTML_N_DL || cmd == HTML_N_BLQ)) { + (h_env->envc == 0 || cmd == HTML_N_BLQ)) { do_blankline(h_env, obuf, envs[h_env->envc].indent, INDENT_INCR, h_env->limit); @@ -4658,11 +4666,13 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); - if (!(obuf->flag & RB_PREMODE)) + if (!(obuf->flag & RB_PREMODE) && envs[h_env->envc].env != HTML_DL + && envs[h_env->envc].env != HTML_DL_COMPACT + && envs[h_env->envc].env != HTML_DD) do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); } - PUSH_ENV(cmd); + PUSH_ENV_NOINDENT(cmd); if (parsedtag_exists(tag, ATTR_COMPACT)) envs[h_env->envc].env = HTML_DL_COMPACT; obuf->flag |= RB_IGNORE_P; @@ -4758,7 +4768,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) (h_env->envc_real < h_env->nenv && envs[h_env->envc].env != HTML_DL && envs[h_env->envc].env != HTML_DL_COMPACT)) { - PUSH_ENV(HTML_DL); + PUSH_ENV_NOINDENT(HTML_DL); } if (h_env->envc > 0) { flushline(h_env, obuf, @@ -4770,6 +4780,16 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) } obuf->flag |= RB_IGNORE_P; return 1; + case HTML_N_DT: + if (!(obuf->flag & RB_IN_DT)) { + return 1; + } + obuf->flag &= ~RB_IN_DT; + HTMLlineproc1("</b>", h_env); + if (h_env->envc > 0 && envs[h_env->envc].env == HTML_DL) + flushline(h_env, obuf, + envs[h_env->envc - 1].indent, 0, h_env->limit); + return 1; case HTML_DD: CLOSE_A; CLOSE_DT; @@ -4779,6 +4799,10 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) envs[h_env->envc].env != HTML_DL_COMPACT)) { PUSH_ENV(HTML_DL); } + + if (h_env->envc <= MAX_INDENT_LEVEL) + envs[h_env->envc].indent = envs[h_env->envc - 1].indent + INDENT_INCR; + if (envs[h_env->envc].env == HTML_DL_COMPACT) { if (obuf->pos > envs[h_env->envc].indent) flushline(h_env, obuf, envs[h_env->envc].indent, 0, @@ -4790,6 +4814,15 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); /* obuf->flag |= RB_IGNORE_P; */ return 1; + case HTML_N_DD: + if (h_env->envc == 0 || + (h_env->envc_real < h_env->nenv && + envs[h_env->envc].env != HTML_DL && + envs[h_env->envc].env != HTML_DL_COMPACT)) + return 1; + envs[h_env->envc].indent = envs[h_env->envc].indent - INDENT_INCR; + flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); + return 1; case HTML_TITLE: close_anchor(h_env, obuf); process_title(tag); |