Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change defaults for mangle and headerIds to false #2890

Merged
merged 1 commit into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export function _getDefaults(): MarkedOptions {
breaks: false,
extensions: null,
gfm: true,
headerIds: true,
headerIds: false,
headerPrefix: '',
highlight: null,
hooks: null,
langPrefix: 'language-',
mangle: true,
mangle: false,
pedantic: false,
renderer: null,
sanitize: false,
Expand Down
8 changes: 4 additions & 4 deletions test/specs/new/heading_following_list.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1 id="level1">level1</h1>
<h2 id="level2">level2</h2>
<h3 id="level3">level3</h3>
<h1>level1</h1>
<h2>level2</h2>
<h3>level3</h3>
<ul>
<li>foo=bar</li>
<li>foo2=bar2</li>
</ul>
<h3 id="level3-1">level3</h3>
<h3>level3</h3>
2 changes: 1 addition & 1 deletion test/specs/new/heading_following_nptable.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
</tr>
</tbody>
</table>
<h1 id="title">title</h1>
<h1>title</h1>
2 changes: 1 addition & 1 deletion test/specs/new/heading_following_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
</tr>
</tbody>
</table>
<h1 id="title">title</h1>
<h1>title</h1>
3 changes: 3 additions & 0 deletions test/specs/new/headings_id.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
headerIds: true
---
### Heading with <em>html</em>

### Heading with a [link](http://github.com/)
Expand Down
26 changes: 13 additions & 13 deletions test/specs/new/html_comments.html
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
<h3 id="example-1">Example 1</h3>
<h3>Example 1</h3>

<!-- comment -->

<h3 id="example-2">Example 2</h3>
<h3>Example 2</h3>

<!---->

<h3 id="example-3">Example 3</h3>
<h3>Example 3</h3>

<!-- -->

<h3 id="example-4">Example 4</h3>
<h3>Example 4</h3>

<!-- - -->

<h3 id="example-5">Example 5</h3>
<h3>Example 5</h3>

<!-- -- -->

<h3 id="example-6">Example 6</h3>
<h3>Example 6</h3>

<!-- --->

<h3 id="example-7">Example 7</h3>
<h3>Example 7</h3>

<!----->

<h3 id="example-8">Example 8</h3>
<h3>Example 8</h3>

<!------>

<h3 id="example-9">Example 9</h3>
<h3>Example 9</h3>

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

<h3 id="example-10">Example 10</h3>
<h3>Example 10</h3>

<!-- multi
line
comment
-->

<h3 id="example-11">Example 11</h3>
<h3>Example 11</h3>

<!-- indented comment -->

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

<h3 id="example-12">Example 12</h3>
<h3>Example 12</h3>

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

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

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

<h3 id="example-13">Example 13</h3>
<h3>Example 13</h3>

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

Expand Down
4 changes: 2 additions & 2 deletions test/specs/new/incorrectly_formatted_list_and_hr.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
</ul>
<hr />

<h2 id="heading--this-one-is-a-heading">
<h2>
<b>heading</b> -this one is a heading
</h2>

<h2 id="heading---this-is-a-heading-too">
<h2>
<b>heading</b> - this is a heading too
</h2>
8 changes: 4 additions & 4 deletions test/specs/new/indented_details.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<details>

<h2 id="heading">Heading</h2>
<h2>Heading</h2>
</details>

<h2 id="heading-1">Heading</h2>
<h2>Heading</h2>
<custom-tag>

<h2 id="heading-2">Heading</h2>
<h2>Heading</h2>
</custom-tag>

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

<pre><code>## Heading</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion test/specs/new/list_code_header.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<ul>
<li>list <h1 id="header">header</h1></li>
<li>list <h1>header</h1></li>
</ul>
6 changes: 3 additions & 3 deletions test/specs/new/nogfm_hashtag.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 id="header">header</h1>
<h1>header</h1>

<h1 id="header1">header1</h1>
<h1>header1</h1>

<h1 id="header2">header2</h1>
<h1>header2</h1>
2 changes: 1 addition & 1 deletion test/specs/new/paragraph-after-list-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<p>paragraph</p>
<ul>
<li>
<h1 id="heading">heading</h1>
<h1>heading</h1>
</li>
</ul>
<p>paragraph</p>
Expand Down
8 changes: 4 additions & 4 deletions test/specs/new/pedantic_heading.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h1 id="h1">h1</h1>
<h1>h1</h1>

<h1 id="h1-1">h1</h1>
<h1>h1</h1>

<h1 id="h1-">h1 #</h1>
<h1>h1 #</h1>

<h1 id="h1-2">h1</h1>
<h1>h1</h1>

<p># h1</p>
4 changes: 2 additions & 2 deletions test/specs/new/pedantic_heading_interrupts_paragraph.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>paragraph before head with hash</p>
<h1 id="how-are-you">how are you</h1>
<h1>how are you</h1>

<p>paragraph before head with equals</p>
<h1 id="how-are-you-again">how are you again</h1>
<h1>how are you again</h1>
18 changes: 9 additions & 9 deletions test/specs/new/relative_base_urls.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<h1 id="absolutization-of-rfc-3986-uris">Absolutization of RFC 3986 URIs</h1>
<h1>Absolutization of RFC 3986 URIs</h1>

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

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

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

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

<h2 id="absolute-path">Absolute path</h2>
<h2>Absolute path</h2>

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

<h2 id="relative-path">Relative path</h2>
<h2>Relative path</h2>

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

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

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

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

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

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

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

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

<h2 id="empty">Empty</h2>
<h2>Empty</h2>

<p><a href="">section 4.2</a></p>
18 changes: 9 additions & 9 deletions test/specs/new/relative_urls.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<h1 id="absolutization-of-rfc-3986-uris">Absolutization of RFC 3986 URIs</h1>
<h1>Absolutization of RFC 3986 URIs</h1>

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

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

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

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

<h2 id="absolute-path">Absolute path</h2>
<h2>Absolute path</h2>

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

<h2 id="relative-path">Relative path</h2>
<h2>Relative path</h2>

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

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

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

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

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

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

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

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

<h2 id="empty">Empty</h2>
<h2>Empty</h2>

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