[PATCH] <Q> quotations
Hi! I've patched Dillo-CVS to do quotes, just like described in HTML 4.01 Spec. (http://www.w3.org/TR/html401/struct/text.html#h-9.2.2), but w/o the cite argument. The reason why there is no cite argument is 1) because i don't know how to parse/access an argument (no big problem, i'll just learn) 2) i don't know how to display it. I find the whole quotation being an anchor a bit annoying, so i'd like you to give me feedback on the patch and how to show the cite-argument. The patch is for the latest cvs(first time i ever make a patch, please forgive me if i made some kind of mistake): --- /home/jon/dillo/tmp/html.c 2003-07-30 13:34:10.000000000 +0200 +++ html.c 2003-07-30 13:48:31.000000000 +0200 @@ -3689,6 +3689,35 @@ static void Html_tag_open_dfn(DilloHtml } /* + * <Q> + */ +static void Html_tag_open_q(DilloHtml *html, char *tag, gint tagsize) +{ + Html_push_tag(html, tag, tagsize); + if(g_strcasecmp(html->stack[html->stack_top-1].tag, "q") == 0) + { + a_Dw_page_add_text(DW_PAGE(html->dw), g_strdup("'"), html->stack[html->stack_top].style); + } + else // It's the first Q-tag + { + a_Dw_page_add_text(DW_PAGE(html->dw), g_strdup("\""), html->stack[html->stack_top].style); + } +} + +static void Html_tag_close_q(DilloHtml *html, char *tag, gint tagsize) +{ + Html_pop_tag(html, tag, tagsize); + if(g_strcasecmp(html->stack[html->stack_top].tag, "q") == 0) + { + a_Dw_page_add_text(DW_PAGE(html->dw), g_strdup("'"), html->stack[html->stack_top].style); + } + else + { + a_Dw_page_add_text(DW_PAGE(html->dw), g_strdup("\""), html->stack[html->stack_top].style); + } +} + +/* * <KBD> */ static void Html_tag_open_kbd(DilloHtml *html, char *tag, gint tagsize) @@ -3843,7 +3872,7 @@ static const TagInfo Tags[] = { {"p", Html_tag_open_p, Html_tag_close_par}, /* param */ {"pre", Html_tag_open_pre, Html_tag_close_par}, - /* q */ + {"q", Html_tag_open_q, Html_tag_close_q}, {"s", Html_tag_open_strike, Html_tag_close_default}, {"samp", Html_tag_open_samp, Html_tag_close_default}, {"script", Html_tag_open_script, Html_tag_close_script}, Testcase: <HTML> <BODY> <P> John said, <Q>I saw Lucy at lunch, she told me <Q>Mary wants you to get some ice cream on your way home.</Q> I think I will get some at Ben and Jerry's, on Gloucester Road.</Q> </P> </BODY> </HTML> Should be: John said, "I saw Lucy at lunch, she told me 'Mary wants you to get some ice cream on your way home.' I think I will get some at Ben and Jerry's, on Gloucester Road." This patch should resolv bug #343. I'm not sure if this was the right place to send it to, but i hope it was. Sorry for my not-so-good english. -- Jon jon@vikinglan.org
participants (1)
-
Johan Hilding