Skip to content

Commit c48c5e4

Browse files
committed
Up pygmentize to 0.5.1. Updated add.xml to have <pre><code> not just <pre> for para-inline code blocks.
1 parent fe197ef commit c48c5e4

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

entries/add.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,31 @@
3535
<desc>Add elements to the set of matched elements.</desc>
3636
<longdesc><p>Given a jQuery object that represents a set of DOM elements, the <code>.add()</code> method constructs a new jQuery object from the union of those elements and the ones passed into the method. The argument to <code>.add()</code> can be pretty much anything that <code>$()</code> accepts, including a jQuery selector expression, references to DOM elements, or an HTML snippet.</p>
3737
<p>The updated set of elements can be used in a following (chained) method, or assigned to a variable for later use. For example:</p>
38-
<pre>
38+
<pre><code>
3939
$("p").add("div").addClass("widget");
4040
var pdiv = $("p").add("div");
41-
</pre>
41+
</code></pre>
4242
<p>The following will <em>not</em> save the added elements, because the <code>.add()</code> method creates a new set and leaves the original set in pdiv unchanged:</p>
43-
<pre>
43+
<pre><code>
4444
var pdiv = $("p");
4545
pdiv.add("div"); // WRONG, pdiv will not change
46-
</pre>
46+
</code></pre>
4747
<p>Consider a page with a simple list and a paragraph following it:</p>
48-
<pre>&lt;ul&gt;
48+
<pre><code>&lt;ul&gt;
4949
&lt;li&gt;list item 1&lt;/li&gt;
5050
&lt;li&gt;list item 2&lt;/li&gt;
5151
&lt;li&gt;list item 3&lt;/li&gt;
5252
&lt;/ul&gt;
53-
&lt;p&gt;a paragraph&lt;/p&gt;</pre>
53+
&lt;p&gt;a paragraph&lt;/p&gt;</code></pre>
5454
<p>We can select the list items and then the paragraph by using either a selector or a reference to the DOM element itself as the <code>.add()</code> method's argument:</p>
55-
<pre>$('li').add('p').css('background-color', 'red');</pre>
55+
<pre><code>$('li').add('p').css('background-color', 'red');</code></pre>
5656
<p>Or:</p>
57-
<pre>$('li').add(document.getElementsByTagName('p')[0])
58-
.css('background-color', 'red');</pre>
57+
<pre><code>$('li').add(document.getElementsByTagName('p')[0])
58+
.css('background-color', 'red');</code></pre>
5959
<p>The result of this call is a red background behind all four elements.
6060
Using an HTML snippet as the <code>.add()</code> method's argument (as in the third version), we can create additional elements on the fly and add those elements to the matched set of elements. Let's say, for example, that we want to alter the background of the list items along with a newly created paragraph:</p>
61-
<pre>$('li').add('&lt;p id="new"&gt;new paragraph&lt;/p&gt;')
62-
.css('background-color', 'red');</pre>
61+
<pre><code>$('li').add('&lt;p id="new"&gt;new paragraph&lt;/p&gt;')
62+
.css('background-color', 'red');</code></pre>
6363
<p>Although the new paragraph has been created and its background color changed, it still does not appear on the page. To place it on the page, we could add one of the insertion methods to the chain.</p>
6464
<p>As of jQuery 1.4 the results from .add() will always be returned in document order (rather than a simple concatenation).</p>
6565
<p><strong>Note:</strong> To reverse the <code>.add()</code> you can use <a href="http://api.jquery.com/not"><code>.not( elements | selector )</code></a> to remove elements from the jQuery results, or <a href="http://api.jquery.com/end"><code>.end()</code></a> to return to the selection before you added.</p>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"grunt": "0.3.x",
2525
"grunt-clean": "0.1.0",
2626
"grunt-wordpress": "0.1.1",
27-
"pygmentize": "0.3.0"
27+
"pygmentize": "0.5.1"
2828
},
2929
"devDependencies": {},
3030
"keywords": []

0 commit comments

Comments
 (0)