Revert "Only read title when in head"

This reverts commit 0189e8aa5c.
This commit is contained in:
Tatsuya Kinoshita
2023-01-07 09:24:03 +09:00
parent c985ae8727
commit de325360b8
2 changed files with 11 additions and 20 deletions
+11 -19
View File
@@ -4817,23 +4817,19 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
/* obuf->flag |= RB_IGNORE_P; */ /* obuf->flag |= RB_IGNORE_P; */
return 1; return 1;
case HTML_TITLE: case HTML_TITLE:
if (obuf->flag & RB_HEAD) { close_anchor(h_env, obuf);
close_anchor(h_env, obuf); process_title(tag);
process_title(tag); obuf->flag |= RB_TITLE;
obuf->flag |= RB_TITLE; obuf->end_tag = HTML_N_TITLE;
obuf->end_tag = HTML_N_TITLE;
}
return 1; return 1;
case HTML_N_TITLE: case HTML_N_TITLE:
if (obuf->flag & RB_HEAD) { if (!(obuf->flag & RB_TITLE))
if (!(obuf->flag & RB_TITLE)) return 1;
return 1; obuf->flag &= ~RB_TITLE;
obuf->flag &= ~RB_TITLE; obuf->end_tag = 0;
obuf->end_tag = 0; tmp = process_n_title(tag);
tmp = process_n_title(tag); if (tmp)
if (tmp) HTMLlineproc1(tmp->ptr, h_env);
HTMLlineproc1(tmp->ptr, h_env);
}
return 1; return 1;
case HTML_TITLE_ALT: case HTML_TITLE_ALT:
if (parsedtag_get_value(tag, ATTR_TITLE, &p)) if (parsedtag_get_value(tag, ATTR_TITLE, &p))
@@ -5528,13 +5524,9 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
} }
} }
case HTML_N_HEAD: case HTML_N_HEAD:
obuf->flag &= ~RB_HEAD;
if (obuf->flag & RB_TITLE) if (obuf->flag & RB_TITLE)
HTMLlineproc1("</title>", h_env); HTMLlineproc1("</title>", h_env);
return 1;
case HTML_HEAD: case HTML_HEAD:
obuf->flag |= RB_HEAD;
return 1;
case HTML_N_BODY: case HTML_N_BODY:
return 1; return 1;
default: default:
-1
View File
@@ -675,7 +675,6 @@ struct readbuffer {
#define RB_DEL 0x100000 #define RB_DEL 0x100000
#define RB_S 0x200000 #define RB_S 0x200000
#define RB_HTML5 0x400000 #define RB_HTML5 0x400000
#define RB_HEAD 0x800000
#define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN) #define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN)
#define RB_SET_ALIGN(obuf,align) do{(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= (align); }while(0) #define RB_SET_ALIGN(obuf,align) do{(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= (align); }while(0)