Opened 15 years ago

Closed 15 years ago

#174 closed defect (fixed)

AddHyperlinksAndLineBreaks template remove existing HTML code in text parameter

Reported by: fxp Owned by: fxp
Priority: minor Milestone: v2.5.0
Component: General Version:
Keywords: Cc:

Description

if text parameter already contains HTML, the template will remove it because using value-of instead of copy-of.

For example the problem occurs on:

  • codelist contains <b> tags,
  • onlinesource <a> tag
  • other text may contains <br/>

The following code does not solve the problem, but does not process text when having HTML in it:

<xsl:variable name="textnode" select="exslt:node-set($text)"/>
				<xsl:choose>
					<xsl:when test="$edit">
						<xsl:copy-of select="$text"/>
					</xsl:when>
					<xsl:when test="count($textnode/*) &gt; 0">
						<!-- In some templates, text already contains HTML (eg. codelist, link for download).
							In that case copy text content and does not resolve
							hyperlinks. -->
						<xsl:copy-of select="$text"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:call-template name="addHyperlinksAndLineBreaks">
							<xsl:with-param name="txt" select="$text"/>
						</xsl:call-template>
					</xsl:otherwise>
				</xsl:choose>			

Change History (2)

comment:1 by fxp, 15 years ago

Owner: changed from heikki to fxp

comment:2 by fxp, 15 years ago

Resolution: fixed
Status: newclosed

Committed revision 5811.

Note: See TracTickets for help on using tickets.