Skip to content

Commit 12eb59f

Browse files
committed
Fix tests to remove IDs from <h1>
1 parent a127307 commit 12eb59f

17 files changed

+298
-312
lines changed

test/index.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -393,20 +393,6 @@ function fix() {
393393
.replace(/&__QUOT__;/g, '"')
394394
.replace(/&__APOS__;/g, '\'');
395395

396-
// add heading id's
397-
html = html.replace(/<(h[1-6])>([^<]+)<\/\1>/g, function(s, h, text) {
398-
var id = text
399-
.replace(/&#39;/g, '\'')
400-
.replace(/&quot;/g, '"')
401-
.replace(/&gt;/g, '>')
402-
.replace(/&lt;/g, '<')
403-
.replace(/&amp;/g, '&');
404-
405-
id = id.toLowerCase().replace(/[^\w]+/g, '-');
406-
407-
return '<' + h + ' id="' + id + '">' + text + '</' + h + '>';
408-
});
409-
410396
fs.writeFileSync(file, html);
411397
});
412398

test/new/cm_autolinks.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
11
<p>Here are some valid autolinks:</p>
22

3-
<h3 id="example-565">Example 565</h3>
3+
<h3>Example 565</h3>
44

55
<p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p>
66

7-
<h3 id="example-566">Example 566</h3>
7+
<h3>Example 566</h3>
88

99
<p><a href="http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean">http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p>
1010

11-
<h3 id="example-567">Example 567</h3>
11+
<h3>Example 567</h3>
1212

1313
<p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p>
1414

15-
<h3 id="example-568">Example 568</h3>
15+
<h3>Example 568</h3>
1616

1717
<p>Uppercase is also fine:</p>
1818

1919
<p><a href="MAILTO:[email protected]">MAILTO:[email protected]</a></p>
2020

2121
<p>Note that many strings that count as absolute URIs for purposes of this spec are not valid URIs, because their schemes are not registered or because of other problems with their syntax:</p>
2222

23-
<h3 id="example-569">Example 569</h3>
23+
<h3>Example 569</h3>
2424

2525
<p><a href="a+b+c:d">a+b+c:d</a></p>
2626

27-
<h3 id="example-570">Example 570</h3>
27+
<h3>Example 570</h3>
2828

2929
<p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p>
3030

31-
<h3 id="example-571">Example 571</h3>
31+
<h3>Example 571</h3>
3232

3333
<p><a href="http://../">http://../</a></p>
3434

35-
<h3 id="example-572">Example 572</h3>
35+
<h3>Example 572</h3>
3636

3737
<p><a href="localhost:5001/foo">localhost:5001/foo</a></p>
3838

39-
<h3 id="example-573">Example 573</h3>
39+
<h3>Example 573</h3>
4040

4141
<p>Spaces are not allowed in autolinks:</p>
4242

4343
<p>&lt;http://foo.bar/baz bim&gt;</p>
4444

45-
<h3 id="example-574">Example 574</h3>
45+
<h3>Example 574</h3>
4646

4747
<p>Backslash-escapes do not work inside autolinks:</p>
4848

4949
<p><a href="http://example.com/%5C%5B%5C">http://example.com/\[\</a></p>
5050

5151
<p>Examples of email autolinks:</p>
5252

53-
<h3 id="example-575">Example 575</h3>
53+
<h3>Example 575</h3>
5454

5555
<p><a href="mailto:[email protected]">[email protected]</a></p>
5656

57-
<h3 id="example-576">Example 576</h3>
57+
<h3>Example 576</h3>
5858

5959
<p><a href="mailto:[email protected]">[email protected]</a></p>
6060

61-
<h3 id="example-577">Example 577</h3>
61+
<h3>Example 577</h3>
6262

6363
<p>Backslash-escapes do not work inside email autolinks:</p>
6464

6565
<p>&lt;[email protected]&gt;</p>
6666

6767
<p>These are not autolinks:</p>
6868

69-
<h3 id="example-578">Example 578</h3>
69+
<h3>Example 578</h3>
7070

7171
<p>&lt;&gt;</p>
7272

73-
<h3 id="example-579">Example 579</h3>
73+
<h3>Example 579</h3>
7474

7575
<p>&lt; http://foo.bar &gt;</p>
7676

77-
<h3 id="example-580">Example 580</h3>
77+
<h3>Example 580</h3>
7878

7979
<p>&lt;m:abc&gt;</p>
8080

81-
<h3 id="example-581">Example 581</h3>
81+
<h3>Example 581</h3>
8282

8383
<p>&lt;foo.bar.baz&gt;</p>
8484

85-
<h3 id="example-582">Example 582</h3>
85+
<h3>Example 582</h3>
8686

8787
<p>http://example.com</p>
8888

89-
<h3 id="example-583">Example 583</h3>
89+
<h3>Example 583</h3>
9090

9191

test/new/cm_blockquotes.html

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
<h3 id="example-191">Example 191</h3>
1+
<h3>Example 191</h3>
22

33
<blockquote>
4-
<h1 id="foo">Foo</h1>
4+
<h1>Foo</h1>
55
<p>bar
66
baz</p>
77
</blockquote>
88

9-
<h3 id="example-192">Example 192</h3>
9+
<h3>Example 192</h3>
1010

1111
<p>The spaces after the <code>&gt;</code> characters can be omitted:</p>
1212

1313
<blockquote>
14-
<h1 id="foo">Foo</h1>
14+
<h1>Foo</h1>
1515
<p>bar
1616
baz</p>
1717
</blockquote>
1818

19-
<h3 id="example-193">Example 193</h3>
19+
<h3>Example 193</h3>
2020

2121
<p>The <code>&gt;</code> characters can be indented 1-3 spaces:</p>
2222

2323
<blockquote>
24-
<h1 id="foo">Foo</h1>
24+
<h1>Foo</h1>
2525
<p>bar
2626
baz</p>
2727
</blockquote>
2828

29-
<h3 id="example-194">Example 194</h3>
29+
<h3>Example 194</h3>
3030

3131
<p>Four spaces gives us a code block:</p>
3232

3333
<pre><code>&gt; # Foo
3434
&gt; bar
3535
&gt; baz</code></pre>
3636

37-
<h3 id="example-195">Example 195</h3>
37+
<h3>Example 195</h3>
3838

3939
<p>The Laziness clause allows us to omit the <code>&gt;</code> before paragraph continuation text:</p>
4040

4141
<blockquote>
42-
<h1 id="foo">Foo</h1>
42+
<h1>Foo</h1>
4343
<p>bar
4444
baz</p>
4545
</blockquote>
4646

47-
<h3 id="example-196">Example 196</h3>
47+
<h3>Example 196</h3>
4848

4949
<p>A block quote can contain some lazy and some non-lazy continuation lines:</p>
5050

@@ -54,7 +54,7 @@ <h3 id="example-196">Example 196</h3>
5454
foo</p>
5555
</blockquote>
5656

57-
<h3 id="example-197">Example 197</h3>
57+
<h3>Example 197</h3>
5858

5959
<p>Laziness only applies to lines that would have been continuations of paragraphs had they been prepended with block quote markers. For example, the <code>&gt;</code> cannot be omitted in the second line of</p>
6060

@@ -65,14 +65,14 @@ <h3 id="example-197">Example 197</h3>
6565

6666
<p>without changing the meaning.</p>
6767

68-
<h3 id="example-198">Example 198</h3>
68+
<h3>Example 198</h3>
6969

7070
<pre><code>Similarly, if we omit the `&gt;` in the second line then the block quote ends after the first line:
7171

7272
&gt; - foo
7373
- bar</code></pre>
7474

75-
<h3 id="example-199">Example 199</h3>
75+
<h3>Example 199</h3>
7676

7777
<p>For the same reason, we can’t omit the <code>&gt;</code> in front of subsequent lines of an indented or fenced code block:</p>
7878

@@ -81,7 +81,7 @@ <h3 id="example-199">Example 199</h3>
8181
</blockquote>
8282
<pre><code>bar</code></pre>
8383

84-
<h3 id="example-200">Example 200</h3>
84+
<h3>Example 200</h3>
8585

8686
<pre><code>&gt; ```
8787
foo
@@ -93,7 +93,7 @@ <h3 id="example-200">Example 200</h3>
9393
&lt;p&gt;foo&lt;/p&gt;
9494
&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;</code></pre>
9595

96-
<h3 id="example-201">Example 201</h3>
96+
<h3>Example 201</h3>
9797
<pre><code>&gt; foo
9898
- bar
9999

@@ -102,19 +102,19 @@ <h3 id="example-201">Example 201</h3>
102102
- bar&lt;/p&gt;
103103
&lt;/blockquote&gt;</code></pre>
104104

105-
<h3 id="example-202">Example 202</h3>
105+
<h3>Example 202</h3>
106106

107107
<p>A block quote can be empty:</p>
108108

109109
<blockquote>
110110
</blockquote>
111111

112-
<h3 id="example-203">Example 203</h3>
112+
<h3>Example 203</h3>
113113

114114
<blockquote>
115115
</blockquote>
116116

117-
<h3 id="example-204">Example 204</h3>
117+
<h3>Example 204</h3>
118118

119119
<p>A block quote can have initial or final blank lines:</p>
120120

@@ -123,7 +123,7 @@ <h3 id="example-204">Example 204</h3>
123123
</blockquote>
124124

125125

126-
<h3 id="example-205">Example 205</h3>
126+
<h3>Example 205</h3>
127127

128128
<p>A blank line always separates block quotes:</p>
129129

@@ -134,7 +134,7 @@ <h3 id="example-205">Example 205</h3>
134134
<p>bar</p>
135135
</blockquote>
136136

137-
<h3 id="example-206">Example 206</h3>
137+
<h3>Example 206</h3>
138138

139139
<p>Consecutiveness means that if we put these block quotes together, we get a single block quote:</p>
140140

@@ -143,7 +143,7 @@ <h3 id="example-206">Example 206</h3>
143143
bar</p>
144144
</blockquote>
145145

146-
<h3 id="example-207">Example 207</h3>
146+
<h3>Example 207</h3>
147147

148148
<p>To get a block quote with two paragraphs, use:</p>
149149

@@ -152,7 +152,7 @@ <h3 id="example-207">Example 207</h3>
152152
<p>bar</p>
153153
</blockquote>
154154

155-
<h3 id="example-208">Example 208</h3>
155+
<h3>Example 208</h3>
156156

157157
<p>Block quotes can interrupt paragraphs:</p>
158158

@@ -161,7 +161,7 @@ <h3 id="example-208">Example 208</h3>
161161
<p>bar</p>
162162
</blockquote>
163163

164-
<h3 id="example-209">Example 209</h3>
164+
<h3>Example 209</h3>
165165

166166
<p>In general, blank lines are not needed before or after block quotes:</p>
167167

@@ -173,7 +173,7 @@ <h3 id="example-209">Example 209</h3>
173173
<p>bbb</p>
174174
</blockquote>
175175

176-
<h3 id="example-210">Example 210</h3>
176+
<h3>Example 210</h3>
177177

178178
<p>However, because of laziness, a blank line is needed between a block quote and a following paragraph:</p>
179179

@@ -182,21 +182,21 @@ <h3 id="example-210">Example 210</h3>
182182
baz</p>
183183
</blockquote>
184184

185-
<h3 id="example-211">Example 211</h3>
185+
<h3>Example 211</h3>
186186

187187
<blockquote>
188188
<p>bar</p>
189189
</blockquote>
190190
<p>baz</p>
191191

192-
<h3 id="example-212">Example 212</h3>
192+
<h3>Example 212</h3>
193193

194194
<blockquote>
195195
<p>bar</p>
196196
</blockquote>
197197
<p>baz</p>
198198

199-
<h3 id="example-213">Example 213</h3>
199+
<h3>Example 213</h3>
200200

201201
<p>It is a consequence of the Laziness rule that any number of initial <code>&gt;</code>s may be omitted on a continuation line of a nested block quote:</p>
202202

@@ -209,7 +209,7 @@ <h3 id="example-213">Example 213</h3>
209209
</blockquote>
210210
</blockquote>
211211

212-
<h3 id="example-214">Example 214</h3>
212+
<h3>Example 214</h3>
213213

214214
<blockquote>
215215
<blockquote>
@@ -221,7 +221,7 @@ <h3 id="example-214">Example 214</h3>
221221
</blockquote>
222222
</blockquote>
223223

224-
<h3 id="example-215">Example 215</h3>
224+
<h3>Example 215</h3>
225225

226226
<p>When including an indented code block in a block quote, remember that the block quote marker includes both the <code>&gt;</code> and a following space. So five spaces are needed after the <code>&gt;</code>:</p>
227227

0 commit comments

Comments
 (0)