commit:     0ecdaa0e247d13ac57a40731fb70e77eae07d418
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  6 18:02:59 2019 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Dec  6 18:04:56 2019 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=0ecdaa0e

devbook.xsl: Fix handling of <uri> without link attribute.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 devbook.xsl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/devbook.xsl b/devbook.xsl
index 39d49f8..b3a14cc 100644
--- a/devbook.xsl
+++ b/devbook.xsl
@@ -336,8 +336,15 @@
           </xsl:otherwise>
         </xsl:choose>
       </xsl:when>
-      <xsl:otherwise>
+      <xsl:when test="@link">
         <a class="{$class}" href="{@link}"><xsl:value-of select="."/></a>
+      </xsl:when>
+      <xsl:when test="contains(., '://')">
+        <a class="{$class}" href="{.}"><xsl:value-of select="."/></a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:message>Error: No link target (<xsl:value-of 
select="."/>)</xsl:message>
+        <a class="{$class}"><xsl:value-of select="."/></a>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>

Reply via email to