diff --git a/src/defaults.js b/src/defaults.js index bce0ea49d6b..33819cbbe6b 100644 --- a/src/defaults.js +++ b/src/defaults.js @@ -5,12 +5,12 @@ export function getDefaults() { 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, diff --git a/test/specs/new/heading_following_list.html b/test/specs/new/heading_following_list.html index b022d175eaa..13a97ef0b0d 100644 --- a/test/specs/new/heading_following_list.html +++ b/test/specs/new/heading_following_list.html @@ -1,8 +1,8 @@ -

level1

-

level2

-

level3

+

level1

+

level2

+

level3

-

level3

+

level3

diff --git a/test/specs/new/heading_following_nptable.html b/test/specs/new/heading_following_nptable.html index 59a3b46ebd5..d08f1118185 100644 --- a/test/specs/new/heading_following_nptable.html +++ b/test/specs/new/heading_following_nptable.html @@ -16,4 +16,4 @@ -

title

+

title

diff --git a/test/specs/new/heading_following_table.html b/test/specs/new/heading_following_table.html index 59a3b46ebd5..d08f1118185 100644 --- a/test/specs/new/heading_following_table.html +++ b/test/specs/new/heading_following_table.html @@ -16,4 +16,4 @@ -

title

+

title

diff --git a/test/specs/new/headings_id.md b/test/specs/new/headings_id.md index 0852c3718f8..27744b4a90f 100644 --- a/test/specs/new/headings_id.md +++ b/test/specs/new/headings_id.md @@ -1,3 +1,6 @@ +--- +headerIds: true +--- ### Heading with html ### Heading with a [link](http://github.com/) diff --git a/test/specs/new/html_comments.html b/test/specs/new/html_comments.html index a1c1f1b7d3a..e920156b62b 100644 --- a/test/specs/new/html_comments.html +++ b/test/specs/new/html_comments.html @@ -1,54 +1,54 @@ -

Example 1

+

Example 1

-

Example 2

+

Example 2

-

Example 3

+

Example 3

-

Example 4

+

Example 4

-

Example 5

+

Example 5

-

Example 6

+

Example 6

-

Example 7

+

Example 7

-

Example 8

+

Example 8

-

Example 9

+

Example 9

-

Example 10

+

Example 10

-

Example 11

+

Example 11

<!-- too much indentation -->
 
-

Example 12

+

Example 12

<!--> not a comment -->

@@ -56,7 +56,7 @@

Example 12

--> -

Example 13

+

Example 13

diff --git a/test/specs/new/incorrectly_formatted_list_and_hr.html b/test/specs/new/incorrectly_formatted_list_and_hr.html index 74f762abd1e..07f646301b4 100644 --- a/test/specs/new/incorrectly_formatted_list_and_hr.html +++ b/test/specs/new/incorrectly_formatted_list_and_hr.html @@ -27,10 +27,10 @@
-

+

heading -this one is a heading

-

+

heading - this is a heading too

diff --git a/test/specs/new/indented_details.html b/test/specs/new/indented_details.html index 910ff957c1d..64c6600057e 100644 --- a/test/specs/new/indented_details.html +++ b/test/specs/new/indented_details.html @@ -1,15 +1,15 @@
-

Heading

+

Heading

-

Heading

+

Heading

-

Heading

+

Heading

-

Heading

+

Heading

## Heading
diff --git a/test/specs/new/list_code_header.html b/test/specs/new/list_code_header.html index 7fab582d370..af101cd761e 100644 --- a/test/specs/new/list_code_header.html +++ b/test/specs/new/list_code_header.html @@ -1,3 +1,3 @@ diff --git a/test/specs/new/nogfm_hashtag.html b/test/specs/new/nogfm_hashtag.html index ecd95d692e1..9b53c8e2307 100644 --- a/test/specs/new/nogfm_hashtag.html +++ b/test/specs/new/nogfm_hashtag.html @@ -1,5 +1,5 @@ -

header

+

header

-

header1

+

header1

-

header2

+

header2

diff --git a/test/specs/new/paragraph-after-list-item.html b/test/specs/new/paragraph-after-list-item.html index 4a366dce308..b8ed681fc27 100644 --- a/test/specs/new/paragraph-after-list-item.html +++ b/test/specs/new/paragraph-after-list-item.html @@ -6,7 +6,7 @@

paragraph

paragraph

diff --git a/test/specs/new/pedantic_heading.html b/test/specs/new/pedantic_heading.html index 7795a3bcccf..9efe5516c05 100644 --- a/test/specs/new/pedantic_heading.html +++ b/test/specs/new/pedantic_heading.html @@ -1,9 +1,9 @@ -

h1

+

h1

-

h1

+

h1

-

h1 #

+

h1 #

-

h1

+

h1

# h1

diff --git a/test/specs/new/pedantic_heading_interrupts_paragraph.html b/test/specs/new/pedantic_heading_interrupts_paragraph.html index 9e232fd65d3..a9ab3352c87 100644 --- a/test/specs/new/pedantic_heading_interrupts_paragraph.html +++ b/test/specs/new/pedantic_heading_interrupts_paragraph.html @@ -1,5 +1,5 @@

paragraph before head with hash

-

how are you

+

how are you

paragraph before head with equals

-

how are you again

+

how are you again

diff --git a/test/specs/new/relative_base_urls.html b/test/specs/new/relative_base_urls.html index 6f94843f569..7c08ac7c5d6 100644 --- a/test/specs/new/relative_base_urls.html +++ b/test/specs/new/relative_base_urls.html @@ -1,35 +1,35 @@ -

Absolutization of RFC 3986 URIs

+

Absolutization of RFC 3986 URIs

-

Absolute URI

+

Absolute URI

section 4.3

-

Network-path reference

+

Network-path reference

section 4.2

-

Absolute path

+

Absolute path

section 4.2

-

Relative path

+

Relative path

section 4.2

-

Dot-relative path

+

Dot-relative path

section 3.3

section 3.3

-

Same-document query

+

Same-document query

section 4.4

-

Same-document fragment

+

Same-document fragment

section 4.4

-

Empty

+

Empty

section 4.2

diff --git a/test/specs/new/relative_urls.html b/test/specs/new/relative_urls.html index ee7f3bff0ea..eb67c1f99dd 100644 --- a/test/specs/new/relative_urls.html +++ b/test/specs/new/relative_urls.html @@ -1,35 +1,35 @@ -

Absolutization of RFC 3986 URIs

+

Absolutization of RFC 3986 URIs

-

Absolute URI

+

Absolute URI

section 4.3

-

Network-path reference

+

Network-path reference

section 4.2

-

Absolute path

+

Absolute path

section 4.2

-

Relative path

+

Relative path

section 4.2

-

Dot-relative path

+

Dot-relative path

section 3.3

section 3.3

-

Same-document query

+

Same-document query

section 4.4

-

Same-document fragment

+

Same-document fragment

section 4.4

-

Empty

+

Empty

section 4.2

diff --git a/test/specs/original/markdown_documentation_basics.md b/test/specs/original/markdown_documentation_basics.md index 23079a330dc..827ea6444b2 100644 --- a/test/specs/original/markdown_documentation_basics.md +++ b/test/specs/original/markdown_documentation_basics.md @@ -1,5 +1,6 @@ --- pedantic: true +headerIds: true --- Markdown: Basics @@ -56,7 +57,7 @@ Markdown: A First Level Header ==================== - + A Second Level Header --------------------- @@ -66,11 +67,11 @@ Markdown: The quick brown fox jumped over the lazy dog's back. - + ### Header 3 > This is a blockquote. - > + > > This is the second paragraph in the blockquote. > > ## This is an H2 in a blockquote @@ -79,23 +80,23 @@ Markdown: Output:

A First Level Header

- +

A Second Level Header

- +

Now is the time for all good men to come to the aid of their country. This is just a regular paragraph.

- +

The quick brown fox jumped over the lazy dog's back.

- +

Header 3

- +

This is a blockquote.

- +

This is the second paragraph in the blockquote.

- +

This is an H2 in a blockquote

@@ -109,7 +110,7 @@ Markdown: Some of these words *are emphasized*. Some of these words _are emphasized also_. - + Use two asterisks for **strong emphasis**. Or, if you prefer, __use two underscores instead__. @@ -117,10 +118,10 @@ Output:

Some of these words are emphasized. Some of these words are emphasized also.

- +

Use two asterisks for strong emphasis. Or, if you prefer, use two underscores instead.

- + ## Lists ## @@ -173,7 +174,7 @@ list item text. You can create multi-paragraph list items by indenting the paragraphs by 4 spaces or 1 tab: * A list item. - + With multiple paragraphs. * Another item in the list. @@ -185,7 +186,7 @@ Output:

With multiple paragraphs.

  • Another item in the list.

  • - + ### Links ### @@ -280,7 +281,7 @@ Output:

    I strongly recommend against using any <blink> tags.

    - +

    I wish SmartyPants used named entities like &mdash; instead of decimal-encoded entites like &#8212;.

    @@ -303,7 +304,7 @@ Output:

    If you want your page to validate under XHTML 1.0 Strict, you've got to put paragraph tags in your blockquotes:

    - +
    <blockquote>
             <p>For example.</p>
         </blockquote>
    diff --git a/test/specs/security/sanitizer_bypass.html b/test/specs/security/sanitizer_bypass.html
    index fb35223cf00..93ea90add86 100644
    --- a/test/specs/security/sanitizer_bypass.html
    +++ b/test/specs/security/sanitizer_bypass.html
    @@ -3,4 +3,4 @@
     

    AAA<sometag> <img <sometag> src=x onerror=alert(1)BBB

    <a>a2<a2t>a2</a> b <c>c</c> d

    -

    text

    +

    text

    diff --git a/test/specs/security/sanitizer_bypass_remove_generic.html b/test/specs/security/sanitizer_bypass_remove_generic.html index 272825867dc..90049f46524 100644 --- a/test/specs/security/sanitizer_bypass_remove_generic.html +++ b/test/specs/security/sanitizer_bypass_remove_generic.html @@ -1,2 +1,2 @@

    a2a2 b c d

    -

    text

    +

    text

    diff --git a/test/unit/Hooks-spec.js b/test/unit/Hooks-spec.js index 0fee5861c3a..dc904eb26af 100644 --- a/test/unit/Hooks-spec.js +++ b/test/unit/Hooks-spec.js @@ -11,7 +11,7 @@ describe('Hooks', () => { } }); const html = marked('*text*'); - expect(html.trim()).toBe('

    preprocess

    \n

    text

    '); + expect(html.trim()).toBe('

    preprocess

    \n

    text

    '); }); it('should preprocess async', async() => { @@ -27,7 +27,7 @@ describe('Hooks', () => { const promise = marked('*text*'); expect(promise).toBeInstanceOf(Promise); const html = await promise; - expect(html.trim()).toBe('

    preprocess async

    \n

    text

    '); + expect(html.trim()).toBe('

    preprocess async

    \n

    text

    '); }); it('should preprocess options', () => { @@ -112,6 +112,6 @@ describe('Hooks', () => { const promise = marked('*text*'); expect(promise).toBeInstanceOf(Promise); const html = await promise; - expect(html.trim()).toBe('

    preprocess1

    \n

    preprocess2

    \n

    text

    \n

    postprocess2 async

    \n

    postprocess1

    '); + expect(html.trim()).toBe('

    preprocess1

    \n

    preprocess2

    \n

    text

    \n

    postprocess2 async

    \n

    postprocess1

    '); }); }); diff --git a/test/unit/Parser-spec.js b/test/unit/Parser-spec.js index 780f0acc694..51834e5216b 100644 --- a/test/unit/Parser-spec.js +++ b/test/unit/Parser-spec.js @@ -50,7 +50,7 @@ describe('Parser', () => { { type: 'text', text: 'heading' } ] }], - html: '

    heading

    ' + html: '

    heading

    ' }); }); diff --git a/test/unit/instance-spec.js b/test/unit/instance-spec.js index 4aab129d494..bfcbd00ee91 100644 --- a/test/unit/instance-spec.js +++ b/test/unit/instance-spec.js @@ -22,7 +22,7 @@ describe('Marked', () => { expect(marked1.parse('# header')).toBe('im marked1'); expect(marked2.parse('# header')).toBe('im marked2'); - expect(marked.parse('# header')).toBe('

    header

    \n'); + expect(marked.parse('# header')).toBe('

    header

    \n'); }); it('should work with use', () => { @@ -48,7 +48,7 @@ describe('Marked', () => { expect(marked1.parse('# header')).toBe('im marked1'); expect(marked2.parse('# header')).toBe('im marked2'); - expect(marked.parse('# header')).toBe('

    header

    \n'); + expect(marked.parse('# header')).toBe('

    header

    \n'); }); it('should work with setOptions', () => { @@ -70,6 +70,6 @@ describe('Marked', () => { expect(marked1.parse('# header')).toBe('im marked1'); expect(marked2.parse('# header')).toBe('im marked2'); - expect(marked.parse('# header')).toBe('

    header

    \n'); + expect(marked.parse('# header')).toBe('

    header

    \n'); }); }); diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index b68ae61c34a..39911873834 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -755,7 +755,7 @@ paragraph # heading `); - expect(html).toBe('extension2 paragraph\nextension1 html\n

    heading

    \n'); + expect(html).toBe('extension2 paragraph\nextension1 html\n

    heading

    \n'); }); it('should use previous extension when returning false', () => {