Skip to content

Commit 997475c

Browse files
committed
Add <desc> note to JSON for excerpt
* excerpt is only semi-escaped in $desc-trans. Really should run through xml2json instead.
1 parent df69696 commit 997475c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

entries/event.stopImmediatePropagation.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
<signature>
44
<added>1.3</added>
55
</signature>
6-
<desc> Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.
7-
</desc>
6+
<desc> Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.</desc>
87
<longdesc><p>In addition to keeping any additional handlers on an element from being executed, this method also stops the bubbling by implicitly calling <code>event.stopPropagation()</code>. To simply prevent the event from bubbling to ancestor elements but allow other event handlers to execute on the same element, we can use <code><a href="http://api.jquery.com/event.stopPropagation">event.stopPropagation()</a></code> instead.</p>
98
<p>Use <code><a href="http://api.jquery.com/event.isImmediatePropagationStopped">event.isImmediatePropagationStopped()</a></code> to know whether this method was ever called (on that event object).</p> </longdesc>
109

entries2html.xsl

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@
2222

2323

2424
<xsl:template match="/">
25+
<xsl:variable name="dquo">"</xsl:variable>
26+
<xsl:variable name="squo">'</xsl:variable>
27+
<xsl:variable name="desc-raw" select="//entry/desc/text()|//entry/desc/*" />
28+
<xsl:variable name="desc-trans" select="translate($desc-raw, $dquo, $squo)" />
29+
2530
<script>
2631
{
2732
"title": "<xsl:value-of select="//entry/@name" />",
33+
"excerpt": "<xsl:copy-of select="$desc-trans" />",
2834
"termSlugs": {
2935
"category": [
3036
<xsl:for-each select="//entry/category"><xsl:if test="position() &gt; 1"><xsl:text>,</xsl:text></xsl:if>"<xsl:value-of select="@slug"/>"</xsl:for-each>
@@ -178,7 +184,7 @@
178184
<xsl:attribute name="id">
179185
<xsl:value-of select="$entry-name-trans" />
180186
<xsl:for-each select="argument">
181-
<xsl:variable name="arg-name" select="translate(@name, ',.)(', '--')" />
187+
<xsl:variable name="arg-name" select="translate(@name, ' ,.)(', '--')" />
182188
<xsl:text>-</xsl:text><xsl:value-of select="$arg-name"/>
183189
</xsl:for-each>
184190
</xsl:attribute>

0 commit comments

Comments
 (0)