Package: newsbeuter / 2.9-8

21-parse-h5-h6-html-headers.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: Fix h5 and h6 html headers not being handled
Origin: upstream, https://github.com/akrennmair/newsbeuter/commit/81d67055447000fe560c91d9a10bd8cdc440cb6b
Bug: https://github.com/akrennmair/newsbeuter/pull/454

--- a/include/htmlrenderer.h
+++ b/include/htmlrenderer.h
@@ -11,7 +11,7 @@
 enum link_type { LINK_HREF, LINK_IMG, LINK_EMBED };
 enum htmltag {
 	TAG_A = 1, TAG_EMBED, TAG_BR, TAG_PRE, TAG_ITUNESHACK,
-	TAG_IMG, TAG_BLOCKQUOTE, TAG_H1, TAG_H2, TAG_H3, TAG_H4,
+	TAG_IMG, TAG_BLOCKQUOTE, TAG_H1, TAG_H2, TAG_H3, TAG_H4,TAG_H5, TAG_H6,
 	TAG_P, TAG_OL, TAG_UL, TAG_LI, TAG_DT, TAG_DD, TAG_DL,
 	TAG_SUP, TAG_SUB, TAG_HR, TAG_STRONG, TAG_UNDERLINE, TAG_QUOTATION,
 	TAG_SCRIPT, TAG_STYLE, TAG_TABLE, TAG_TH, TAG_TR, TAG_TD
--- a/src/htmlrenderer.cpp
+++ b/src/htmlrenderer.cpp
@@ -27,6 +27,8 @@
 	tags["h2"] = TAG_H2;
 	tags["h3"] = TAG_H3;
 	tags["h4"] = TAG_H4;
+	tags["h5"] = TAG_H5;
+	tags["h6"] = TAG_H6;
 	tags["ol"] = TAG_OL;
 	tags["ul"] = TAG_UL;
 	tags["li"] = TAG_LI;
@@ -212,6 +214,8 @@
 			case TAG_H2:
 			case TAG_H3:
 			case TAG_H4:
+			case TAG_H5:
+			case TAG_H6:
 			case TAG_P:
 				add_nonempty_line(curline, tables, lines);
 				if (lines.size() > 0 && lines[lines.size()-1].length() > static_cast<unsigned int>(indent_level*2))
@@ -432,6 +436,8 @@
 			case TAG_H2:
 			case TAG_H3:
 			case TAG_H4:
+			case TAG_H5:
+			case TAG_H6:
 			case TAG_P:
 				add_nonempty_line(curline, tables, lines);
 				prepare_newline(curline,  tables.size() ? 0 : indent_level);