Re: hyphenation in dillo

"Sebastian Geerken" <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
On Thu, Sep 13, Alexander Voigt wrote:
> On Mon, Sep 10, 2012 at 08:45:22PM +0200, Sebastian Geerken wrote:
> > No, not yet. BTW: I haven't understood whether "xml:" is a normal
> > namespace prefix (for which namespace?) or is specialy reserved (and
> > may so not be used as namespace prefix). In the latter case, support
> > would be rather simple.
> 
> As written in [1], the "xml:" prefix is bound to the namespace
> http://www.w3.org/XML/1998/namespace , which is reseved for the W3C.
> This means that the nobody, except the W3C, can reuse this prefix for
> their own namespace.
> 
> So, as long as the meaning of "xml:lang" does not change (which is
> very unlikely), it can be interpreted in the same way as the "lang"
> attribute.

So, this simple patch (or similar):

----------------------------------------------------------------------
diff -r d0a8d2a5ede3 src/html.cc
--- a/src/html.cc       Thu Sep 13 12:35:54 2012 +0200
+++ b/src/html.cc       Fri Sep 14 12:35:38 2012 +0200
@@ -3448,6 +3448,15 @@
          html->styleEngine->setNonCssHint(PROPERTY_X_LANG,
CSS_TYPE_STRING,
                                           attrbuf);
    }
+
+   if (tagsize >= 14) { /* TODO prefs.hyphenate? */
+      /* length of "<t xml:lang=i>" */
+      attrbuf = Html_get_attr2(html, tag, tagsize, "xml:lang",
+                               HTML_LeftTrim | HTML_RightTrim);
+      if (attrbuf)
+         html->styleEngine->setNonCssHint(PROPERTY_X_LANG,
CSS_TYPE_STRING,
+                                          attrbuf);
+   }
 }
 
 static void Html_display_block(DilloHtml *html)
----------------------------------------------------------------------

would work, without bothering about XML namespaces (in the near
future). What do the other developers think?

Sebastian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.