Skip to content

Commit 63a839b

Browse files
authored
fix: change defaults for mangle and headerIds to false (#2890)
BREAKING CHANGE: change defaults for mangle and headerIds to false
1 parent f4834ca commit 63a839b

22 files changed

+87
-83
lines changed

Diff for: src/defaults.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export function _getDefaults(): MarkedOptions {
1010
breaks: false,
1111
extensions: null,
1212
gfm: true,
13-
headerIds: true,
13+
headerIds: false,
1414
headerPrefix: '',
1515
highlight: null,
1616
hooks: null,
1717
langPrefix: 'language-',
18-
mangle: true,
18+
mangle: false,
1919
pedantic: false,
2020
renderer: null,
2121
sanitize: false,

Diff for: test/specs/new/heading_following_list.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<h1 id="level1">level1</h1>
2-
<h2 id="level2">level2</h2>
3-
<h3 id="level3">level3</h3>
1+
<h1>level1</h1>
2+
<h2>level2</h2>
3+
<h3>level3</h3>
44
<ul>
55
<li>foo=bar</li>
66
<li>foo2=bar2</li>
77
</ul>
8-
<h3 id="level3-1">level3</h3>
8+
<h3>level3</h3>

Diff for: test/specs/new/heading_following_nptable.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
</tr>
1717
</tbody>
1818
</table>
19-
<h1 id="title">title</h1>
19+
<h1>title</h1>

Diff for: test/specs/new/heading_following_table.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
</tr>
1717
</tbody>
1818
</table>
19-
<h1 id="title">title</h1>
19+
<h1>title</h1>

Diff for: test/specs/new/headings_id.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
headerIds: true
3+
---
14
### Heading with <em>html</em>
25

36
### Heading with a [link](http://github.com/)

Diff for: test/specs/new/html_comments.html

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
<h3 id="example-1">Example 1</h3>
1+
<h3>Example 1</h3>
22

33
<!-- comment -->
44

5-
<h3 id="example-2">Example 2</h3>
5+
<h3>Example 2</h3>
66

77
<!---->
88

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

1111
<!-- -->
1212

13-
<h3 id="example-4">Example 4</h3>
13+
<h3>Example 4</h3>
1414

1515
<!-- - -->
1616

17-
<h3 id="example-5">Example 5</h3>
17+
<h3>Example 5</h3>
1818

1919
<!-- -- -->
2020

21-
<h3 id="example-6">Example 6</h3>
21+
<h3>Example 6</h3>
2222

2323
<!-- --->
2424

25-
<h3 id="example-7">Example 7</h3>
25+
<h3>Example 7</h3>
2626

2727
<!----->
2828

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

3131
<!------>
3232

33-
<h3 id="example-9">Example 9</h3>
33+
<h3>Example 9</h3>
3434

3535
<!-- My favorite operators are > and <!-->
3636

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

3939
<!-- multi
4040
line
4141
comment
4242
-->
4343

44-
<h3 id="example-11">Example 11</h3>
44+
<h3>Example 11</h3>
4545

4646
<!-- indented comment -->
4747

4848
<pre><code>&lt;!-- too much indentation --&gt;
4949
</code></pre>
5050

51-
<h3 id="example-12">Example 12</h3>
51+
<h3>Example 12</h3>
5252

5353
<p>&lt;!--&gt; not a comment --&gt;</p>
5454

5555
<p>&lt;!---&gt; not a comment --&gt;</p>
5656

5757
<!-- <!-- not a comment? --> -->
5858

59-
<h3 id="example-13">Example 13</h3>
59+
<h3>Example 13</h3>
6060

6161
<!-- block ends at the end of the document since --!>
6262

Diff for: test/specs/new/incorrectly_formatted_list_and_hr.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
</ul>
2828
<hr />
2929

30-
<h2 id="heading--this-one-is-a-heading">
30+
<h2>
3131
<b>heading</b> -this one is a heading
3232
</h2>
3333

34-
<h2 id="heading---this-is-a-heading-too">
34+
<h2>
3535
<b>heading</b> - this is a heading too
3636
</h2>

Diff for: test/specs/new/indented_details.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<details>
22

3-
<h2 id="heading">Heading</h2>
3+
<h2>Heading</h2>
44
</details>
55

6-
<h2 id="heading-1">Heading</h2>
6+
<h2>Heading</h2>
77
<custom-tag>
88

9-
<h2 id="heading-2">Heading</h2>
9+
<h2>Heading</h2>
1010
</custom-tag>
1111

12-
<h2 id="heading-3">Heading</h2>
12+
<h2>Heading</h2>
1313
<details>
1414

1515
<pre><code>## Heading</code></pre>

Diff for: test/specs/new/list_code_header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<ul>
2-
<li>list <h1 id="header">header</h1></li>
2+
<li>list <h1>header</h1></li>
33
</ul>

Diff for: test/specs/new/nogfm_hashtag.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<h1 id="header">header</h1>
1+
<h1>header</h1>
22

3-
<h1 id="header1">header1</h1>
3+
<h1>header1</h1>
44

5-
<h1 id="header2">header2</h1>
5+
<h1>header2</h1>

Diff for: test/specs/new/paragraph-after-list-item.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<p>paragraph</p>
77
<ul>
88
<li>
9-
<h1 id="heading">heading</h1>
9+
<h1>heading</h1>
1010
</li>
1111
</ul>
1212
<p>paragraph</p>

Diff for: test/specs/new/pedantic_heading.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<h1 id="h1">h1</h1>
1+
<h1>h1</h1>
22

3-
<h1 id="h1-1">h1</h1>
3+
<h1>h1</h1>
44

5-
<h1 id="h1-">h1 #</h1>
5+
<h1>h1 #</h1>
66

7-
<h1 id="h1-2">h1</h1>
7+
<h1>h1</h1>
88

99
<p># h1</p>
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p>paragraph before head with hash</p>
2-
<h1 id="how-are-you">how are you</h1>
2+
<h1>how are you</h1>
33

44
<p>paragraph before head with equals</p>
5-
<h1 id="how-are-you-again">how are you again</h1>
5+
<h1>how are you again</h1>

Diff for: test/specs/new/relative_base_urls.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
<h1 id="absolutization-of-rfc-3986-uris">Absolutization of RFC 3986 URIs</h1>
1+
<h1>Absolutization of RFC 3986 URIs</h1>
22

3-
<h2 id="absolute-uri">Absolute URI</h2>
3+
<h2>Absolute URI</h2>
44

55
<p><a href="http://example.com/"><img src="http://example.com/logo" alt="section 4.3"></a></p>
66

7-
<h2 id="network-path-reference">Network-path reference</h2>
7+
<h2>Network-path reference</h2>
88

99
<p><a href="//example.com/"><img src="//example.com/logo" alt="section 4.2"></a></p>
1010

11-
<h2 id="absolute-path">Absolute path</h2>
11+
<h2>Absolute path</h2>
1212

1313
<p><a href="/path/to/content"><img src="/path/to/img" alt="section 4.2"></a></p>
1414

15-
<h2 id="relative-path">Relative path</h2>
15+
<h2>Relative path</h2>
1616

1717
<p><a href="/base/content"><img src="/base/img" alt="section 4.2"></a></p>
1818

19-
<h2 id="dot-relative-path">Dot-relative path</h2>
19+
<h2>Dot-relative path</h2>
2020

2121
<p><a href="/base/./content"><img src="/base/./img" alt="section 3.3"></a></p>
2222

2323
<p><a href="/base/../content"><img src="/base/../img" alt="section 3.3"></a></p>
2424

25-
<h2 id="same-document-query">Same-document query</h2>
25+
<h2>Same-document query</h2>
2626

2727
<p><a href="?"><img src="?type=image" alt="section 4.4"></a></p>
2828

29-
<h2 id="same-document-fragment">Same-document fragment</h2>
29+
<h2>Same-document fragment</h2>
3030

3131
<p><a href="#"><img src="#img" alt="section 4.4"></a></p>
3232

33-
<h2 id="empty">Empty</h2>
33+
<h2>Empty</h2>
3434

3535
<p><a href="">section 4.2</a></p>

Diff for: test/specs/new/relative_urls.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
<h1 id="absolutization-of-rfc-3986-uris">Absolutization of RFC 3986 URIs</h1>
1+
<h1>Absolutization of RFC 3986 URIs</h1>
22

3-
<h2 id="absolute-uri">Absolute URI</h2>
3+
<h2>Absolute URI</h2>
44

55
<p><a href="http://example.com/"><img src="http://example.com/logo" alt="section 4.3"></a></p>
66

7-
<h2 id="network-path-reference">Network-path reference</h2>
7+
<h2>Network-path reference</h2>
88

99
<p><a href="http://example.com/"><img src="http://example.com/logo" alt="section 4.2"></a></p>
1010

11-
<h2 id="absolute-path">Absolute path</h2>
11+
<h2>Absolute path</h2>
1212

1313
<p><a href="http://example.com/path/to/content"><img src="http://example.com/path/to/img" alt="section 4.2"></a></p>
1414

15-
<h2 id="relative-path">Relative path</h2>
15+
<h2>Relative path</h2>
1616

1717
<p><a href="http://example.com/base/content"><img src="http://example.com/base/img" alt="section 4.2"></a></p>
1818

19-
<h2 id="dot-relative-path">Dot-relative path</h2>
19+
<h2>Dot-relative path</h2>
2020

2121
<p><a href="http://example.com/base/./content"><img src="http://example.com/base/./img" alt="section 3.3"></a></p>
2222

2323
<p><a href="http://example.com/base/../content"><img src="http://example.com/base/../img" alt="section 3.3"></a></p>
2424

25-
<h2 id="same-document-query">Same-document query</h2>
25+
<h2>Same-document query</h2>
2626

2727
<p><a href="?"><img src="?type=image" alt="section 4.4"></a></p>
2828

29-
<h2 id="same-document-fragment">Same-document fragment</h2>
29+
<h2>Same-document fragment</h2>
3030

3131
<p><a href="#"><img src="#img" alt="section 4.4"></a></p>
3232

33-
<h2 id="empty">Empty</h2>
33+
<h2>Empty</h2>
3434

3535
<p><a href="">section 4.2</a></p>

0 commit comments

Comments
 (0)