support support for the <q> tag (short quote) - webdump - HTML to plain-text converter for webpages
HTML git clone git://git.codemadness.org/webdump
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 555cadf2ae02a70c4bd12cd9cd6bca68a50042a9
DIR parent f86c73c2c7bdc1f6a1af0191c71a7ce0fa7e2d35
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Thu, 2 Jul 2026 19:24:17 +0200
support support for the <q> tag (short quote)
Diffstat:
M webdump.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
---
DIR diff --git a/webdump.c b/webdump.c
@@ -73,7 +73,8 @@ enum DisplayType {
DisplayButton = 1 << 14,
DisplaySelect = 1 << 15,
DisplaySelectMulti = 1 << 16,
- DisplayOption = 1 << 17
+ DisplayOption = 1 << 17,
+ DisplayQuote = 1 << 18
};
/* ANSI markup */
@@ -102,9 +103,9 @@ enum TagId { TagA = 1, TagAddress, TagArea, TagArticle, TagAside, TagAudio,
TagH3, TagH4, TagH5, TagH6, TagHead, TagHeader, TagHr, TagHtml, TagI,
TagIframe, TagImg, TagInput, TagIns, TagLabel, TagLegend, TagLi,
TagLink, TagMain, TagMark, TagMenu, TagMeta, TagNav, TagObject, TagOl,
- TagOption, TagP, TagParam, TagPre, TagS, TagScript, TagSearch,
- TagSection, TagSelect, TagSource, TagStrike, TagStrong, TagStyle,
- TagSummary, TagSvg, TagTable, TagTbody, TagTd, TagTemplate,
+ TagOption, TagP, TagParam, TagPre, TagQ, TagS, TagScript,
+ TagSearch, TagSection, TagSelect, TagSource, TagStrike, TagStrong,
+ TagStyle, TagSummary, TagSvg, TagTable, TagTbody, TagTd, TagTemplate,
TagTextarea, TagTfoot, TagTh, TagThead, TagTitle, TagTr, TagTrack,
TagU, TagUl, TagVar, TagVideo, TagWbr, TagXmp };
@@ -312,6 +313,7 @@ static struct tag tags[] = {
{ "p", TagP, DisplayBlock, 0, 0, 0, 1, 1, 1, 0 },
{ "param", TagParam, DisplayInline, 0, 0, 1, 0, 0, 0, 0 },
{ "pre", TagPre, DisplayPre, 0, 0, 0, 0, 1, 1, 4 },
+{ "q", TagQ, DisplayInline | DisplayQuote, 0, 0, 0, 0, 0, 0, 0 },
{ "s", TagS, DisplayInline, MarkupStrike, 0, 0, 0, 0, 0, 0 },
{ "script", TagScript, DisplayNone, 0, 0, 0, 0, 0, 0, 0 },
{ "search", TagSearch, DisplayBlock, 0, 0, 0, 0, 0, 0, 0 },
@@ -1726,11 +1728,14 @@ handleendtag(struct tag *tag)
if (reader_ignore)
return;
+ if (tag->displaytype & DisplayQuote) {
+ hputchar('"');
+ hflush();
+ }
if (tag->displaytype & (DisplayButton | DisplayOption)) {
hputchar(']');
hflush();
}
-
if (tag->displaytype & (DisplayBlock | DisplayHeader | DisplayTable | DisplayTableRow |
DisplayList | DisplayListItem | DisplayPre)) {
endblock(); /* break line if needed */
@@ -2155,6 +2160,10 @@ xmltagstartparsed(XMLParser *p, const char *t, size_t tl, int isshort)
startblock(); /* break line if needed */
}
+ if (cur->tag.displaytype & DisplayQuote) {
+ hflush();
+ hputchar('"');
+ }
if (cur->tag.displaytype & (DisplayButton | DisplayOption)) {
hflush();
hputchar('[');