diff options
author | William Ting <william.h.ting@gmail.com> | 2012-04-03 21:42:56 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-05-02 04:49:48 +0800 |
commit | afc5412ee87d1bf9bae16ff1c2b6ea7e3043d1e2 (patch) | |
tree | 16cd9531628e0d22830c36e9e06489f03f0c1067 | |
parent | 43c56077a25778deaa9d96e19633d3482cd70c0d (diff) | |
download | gsoc2013-epiphany-afc5412ee87d1bf9bae16ff1c2b6ea7e3043d1e2.tar gsoc2013-epiphany-afc5412ee87d1bf9bae16ff1c2b6ea7e3043d1e2.tar.gz gsoc2013-epiphany-afc5412ee87d1bf9bae16ff1c2b6ea7e3043d1e2.tar.bz2 gsoc2013-epiphany-afc5412ee87d1bf9bae16ff1c2b6ea7e3043d1e2.tar.lz gsoc2013-epiphany-afc5412ee87d1bf9bae16ff1c2b6ea7e3043d1e2.tar.xz gsoc2013-epiphany-afc5412ee87d1bf9bae16ff1c2b6ea7e3043d1e2.tar.zst gsoc2013-epiphany-afc5412ee87d1bf9bae16ff1c2b6ea7e3043d1e2.zip |
epiphany-bookmarks-html.xsl: prioritize smart link URIs over regular links
When exporting bookmarks to HTML, certain smart link metadata is lost that would
otherwise be preserved in RDF / XML format. Now smart link URIs are used in
place of regular link URIs if they exist.
https://bugzilla.gnome.org/show_bug.cgi?id=534565
-rw-r--r-- | data/epiphany-bookmarks-html.xsl | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/data/epiphany-bookmarks-html.xsl b/data/epiphany-bookmarks-html.xsl index 702b14b2b..680007b9e 100644 --- a/data/epiphany-bookmarks-html.xsl +++ b/data/epiphany-bookmarks-html.xsl @@ -4,6 +4,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:purl="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:ephy="http://gnome.org/ns/epiphany#" exclude-result-prefixes="dc purl rdf"> <!-- Copyright © 2004 Stefan Rotsch @@ -48,7 +49,15 @@ $Id$ <dt><h3><xsl:value-of select="." /></h3><dl> <xsl:for-each select="key('topics', .)"> <xsl:sort select="purl:title" /> - <dt><a href="{./purl:link}"><xsl:value-of select="./purl:title" /></a></dt> + <!-- Use smart link URIs if they exist, see bug #534565 --> + <xsl:choose> + <xsl:when test="ephy:smartlink"> + <dt><a href="{./ephy:smartlink}"><xsl:value-of select="./purl:title" /></a></dt> + </xsl:when> + <xsl:otherwise> + <dt><a href="{./purl:link}"><xsl:value-of select="./purl:title" /></a></dt> + </xsl:otherwise> + </xsl:choose> </xsl:for-each> <!-- Force a linebreak; otherwise thinks will break for Topics with only 1 item --> @@ -60,9 +69,17 @@ $Id$ <!-- Now Bookmarks without topics will be added at the bottom of the output file --> <xsl:for-each select="purl:item"> <xsl:sort select="./purl:title" /> - <xsl:if test="not(dc:subject)"> - <dt><a href="{./purl:link}"><xsl:value-of select="./purl:title" /></a></dt> - </xsl:if> + <xsl:if test="not(dc:subject)"> + <!-- Use smart link URIs if they exist, see bug #534565 --> + <xsl:choose> + <xsl:when test="ephy:smartlink"> + <dt><a href="{./ephy:smartlink}"><xsl:value-of select="./purl:title" /></a></dt> + </xsl:when> + <xsl:otherwise> + <dt><a href="{./purl:link}"><xsl:value-of select="./purl:title" /></a></dt> + </xsl:otherwise> + </xsl:choose> + </xsl:if> </xsl:for-each> <!-- Closing tag of outer dl --> |