mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
CSV import: support \n as new line on notes field
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
86988f9cdc
commit
f638b7ef80
1 changed files with 22 additions and 1 deletions
|
@ -431,12 +431,17 @@
|
|||
</xsl:if>
|
||||
|
||||
<xsl:if test="$notesField >= 0">
|
||||
<notes>
|
||||
<xsl:variable name="note">
|
||||
<xsl:call-template name="getFieldByIndex">
|
||||
<xsl:with-param name="index" select="$notesField"/>
|
||||
<xsl:with-param name="line" select="$line"/>
|
||||
<xsl:with-param name="remaining" select="$remaining"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<notes>
|
||||
<xsl:call-template name="new-line">
|
||||
<xsl:with-param name="str" select="$note" />
|
||||
</xsl:call-template>
|
||||
</notes>
|
||||
</xsl:if>
|
||||
|
||||
|
@ -468,4 +473,20 @@
|
|||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="new-line">
|
||||
<xsl:param name="str"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($str, '\n')">
|
||||
<xsl:value-of select="substring-before($str, '\n')"/>
|
||||
<xsl:value-of select="$lf"/>
|
||||
<xsl:call-template name="new-line">
|
||||
<xsl:with-param name="str" select="substring-after($str, '\n')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$str"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Reference in a new issue