PR: MPXDOC-82
fix handling of a href git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114987 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
8b960dc3f7
commit
f5f0dd4dbc
3 files changed
+30
-13
No files matched your search
@@ -425,17 +425,27 @@
|
||||
</jsl:template>
|
||||
|
||||
<!-- remove the space at the end of parsed "a" anchors and fix local hrefs -->
|
||||
<jsl:template match="a" trim="true"><x:element name="a">
|
||||
<x:forEach var="attr" select="@*">
|
||||
<j:choose>
|
||||
<j:when test="${attr.name == 'href' and attr.value.startsWith('#')}">
|
||||
<x:attribute name="href"><doc:escapeNameToken value="${attr.value}"/></x:attribute>
|
||||
</j:when>
|
||||
<j:otherwise><x:attribute name="${attr.name}">${attr.value}</x:attribute></j:otherwise>
|
||||
</j:choose>
|
||||
</x:forEach>
|
||||
<jsl:applyTemplates/>
|
||||
</x:element></jsl:template>
|
||||
<jsl:template match="a" trim="true">
|
||||
<j:set var="href"><x:expr select="@href" /></j:set>
|
||||
<j:choose>
|
||||
<j:when test="${!empty(href) and href.startsWith('#')}">
|
||||
<x:element name="a" trim="true">
|
||||
<x:forEach var="attr" select="@*">
|
||||
<j:choose>
|
||||
<j:when test="${attr.name == 'href'}">
|
||||
<x:attribute name="href"><doc:escapeNameToken value="${attr.value}"/></x:attribute>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<x:attribute name="${attr.name}">${attr.value}</x:attribute>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
</x:forEach>
|
||||
<jsl:applyTemplates/>
|
||||
</x:element>
|
||||
</j:when>
|
||||
<j:otherwise><jsl:copy><jsl:applyTemplates/></jsl:copy></j:otherwise>
|
||||
</j:choose>
|
||||
</jsl:template>
|
||||
|
||||
<!-- copy any other elements through -->
|
||||
<jsl:template match="*" trim="false"><jsl:copy trim="false"><jsl:applyTemplates trim="false"/></jsl:copy></jsl:template>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
-->
|
||||
|
||||
<!-- $Id: test.xml,v 1.2 2004/03/04 18:39:49 evenisse Exp $ -->
|
||||
<!-- $Id: test.xml,v 1.3 2004/04/08 00:42:45 brett Exp $ -->
|
||||
<!DOCTYPE document [
|
||||
<!ENTITY % common-links SYSTEM "../common/links.xml">
|
||||
%common-links;
|
||||
@@ -32,6 +32,11 @@
|
||||
<body>
|
||||
<section name="test1">
|
||||
&_module;
|
||||
|
||||
<p><a href="#Section 2">blah</a></p>
|
||||
</section>
|
||||
<section name="Section 2">
|
||||
<p><a href="/servlet/x?param=1&q=foo">foo -> bar</a></p>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
</document>
|
||||
@@ -25,6 +25,8 @@
|
||||
</properties>
|
||||
<body>
|
||||
<release version="1.7-SNAPSHOT" date="in CVS">
|
||||
<action dev="brett" type="fix">remove changes-report.xml which was generating over the top of the actual report. This information already exists in the changes plugin documentation.</action>
|
||||
<action dev="brett" type="fix" issue="MPXDOC-82">fix processing of a href links</action>
|
||||
<action dev="brett" type="fix" issue="MPXDOC-84">fix URI problems</action>
|
||||
<action dev="dion" type="fix" issue="MPXDOC-89">html tags not passed through for source and pre tags</action>
|
||||
</release>
|
||||
|
||||
Reference in new issue
Block a user