Mike Gerwitz

Activist for User Freedom

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mtg@gnu.org>2015-09-29 21:27:55 -0400
committerMike Gerwitz <mtg@gnu.org>2015-09-29 21:27:55 -0400
commit5c4059e20ad0aa85262b20797ea32b9e02af16c2 (patch)
tree94436f4cc0b138c36e5e871fa83950011a1dc2a4
parentab0d0a8e46b1377e8c56005b7b7005d2263e1ca8 (diff)
downloadliterate-xsl-5c4059e20ad0aa85262b20797ea32b9e02af16c2.tar.gz
literate-xsl-5c4059e20ad0aa85262b20797ea32b9e02af16c2.tar.bz2
literate-xsl-5c4059e20ad0aa85262b20797ea32b9e02af16c2.zip
Do not treat line-separated comments as docblocks
This is already handled by the `is-docblock` predicate, but was also needed here. In particular, if we have a situation like this: ```xml <!-- No a docblock. --> <function name="foo"> <!-- ... --> </function> ``` we do not want that comment to be considered the docblock of `foo`, since it does not appear immediately adjacent to it.
-rw-r--r--src/texinfo.xsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/texinfo.xsl b/src/texinfo.xsl
index bf1ff3a..07c7e99 100644
--- a/src/texinfo.xsl
+++ b/src/texinfo.xsl
@@ -192,7 +192,8 @@
<param name="context" as="node()" />
<sequence select="( ( $context/preceding-sibling::node()[
- not( . instance of text() ) ] )
+ not( . instance of text()
+ and . = $xt:nl ) ] )
[ last() ] )
[ . instance of comment() ]" />
</function>