On Sat, 14 Jun 2003, Stephen Lewis wrote:
Just a comment about this - I'm using a recent CVS version some time after this was integrated, and it causes some display issues with a lot of sites. In particular, sites that use narrow IFRAMEs for ads in a table(e.g. http://www.osnews.com, http://arstechnica.com/ ). The displayed URL seems to force the column width to be much, much wider than it normally would, making these websites look very bad (very wide column with ads, very narrow column with actual text :/ )
It's great having this patch apart from the display issues it causes. Would it be possible to make the displayed URL wrap?
I made it to replace the middle of long urls with ... for iframes: diff -pru -x CVS -x configure -x 'aclocal*' -x 'Makefile*' -x config.h.in cvs/dillo/src/html.c dillo/src/html.c --- cvs/dillo/src/html.c 2003-06-11 23:43:07.000000000 +0300 +++ dillo/src/html.c 2003-06-12 21:18:36.000000000 +0300 @@ -1603,12 +1612,12 @@ static void Html_tag_open_tr(DilloHtml * static void Html_tag_open_frame (DilloHtml *html, gchar *tag, gint tagsize) { const char *attrbuf; - gchar *src; + gchar *src, *buf, *name; DilloUrl *url; DwPage *page; DwStyle style_attrs, *link_style; DwWidget *bullet; - gint dummy; + gint dummy, len; page = DW_PAGE(html->dw); @@ -1641,10 +1650,18 @@ static void Html_tag_open_frame (DilloHt a_Dw_page_add_space(page, html->stack[html->stack_top].style); /* If 'name' tag is present use it, if not use 'src' value */ - if ( !(attrbuf = Html_get_attr(html, tag, tagsize, "name")) ) { + if ( !!(attrbuf = Html_get_attr(html, tag, tagsize, "name")) ) { + a_Dw_page_add_text(page, g_strdup(attrbuf), link_style); + } else if (tolower(tag[1]) != 'i' || (len = strlen(name = src)) < 16 || + (name += 7, len -= 7) < 16) { a_Dw_page_add_text(page, g_strdup(src), link_style); } else { - a_Dw_page_add_text(page, g_strdup(attrbuf), link_style); + buf = g_malloc(16); + memcpy(buf, name, 6); + strcpy(buf + 6, "..."); + memcpy(buf + 9, name + (len - 6), 6); + buf[15] = 0; + a_Dw_page_add_text(page, buf, link_style); } a_Dw_page_add_parbreak(page, 5, html->stack[(html)->stack_top].style);