From 17a4493e967b2aa6b21cb0991bc81352d776f758 Mon Sep 17 00:00:00 2001 From: Brian Armstrong Date: Mon, 10 Oct 2016 22:17:52 -0400 Subject: [PATCH] Add start attribute to first ol element --- lib/rules_block/list.js | 4 +- test/fixtures/commonmark/good.txt | 38 +++++++++---------- .../markdown-it/commonmark_extras.txt | 2 +- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/lib/rules_block/list.js b/lib/rules_block/list.js index 4a052f3..cf7abaf 100644 --- a/lib/rules_block/list.js +++ b/lib/rules_block/list.js @@ -176,9 +176,7 @@ module.exports = function list(state, startLine, endLine, silent) { if (isOrdered) { token = state.push('ordered_list_open', 'ol', 1); - if (markerValue !== 1) { - token.attrs = [ [ 'start', markerValue ] ]; - } + token.attrs = [ [ 'start', markerValue ] ]; } else { token = state.push('bullet_list_open', 'ul', 1); diff --git a/test/fixtures/commonmark/good.txt b/test/fixtures/commonmark/good.txt index ec87519..6714062 100644 --- a/test/fixtures/commonmark/good.txt +++ b/test/fixtures/commonmark/good.txt @@ -952,7 +952,7 @@ src line: 1417 - bar . -
    +
    1. foo

        @@ -2888,7 +2888,7 @@ src line: 3668 > A block quote. . -
          +
          1. A paragraph with two lines.

            @@ -2972,7 +2972,7 @@ src line: 3762 .
            -
              +
              1. one

                two

                @@ -3043,7 +3043,7 @@ src line: 3838 > bam . -
                  +
                  1. foo

                    bar
                    @@ -3191,7 +3191,7 @@ src line: 4001
                     
                            more code
                     .
                    -
                      +
                      1. indented code
                         
                        @@ -3212,7 +3212,7 @@ src line: 4023 more code . -
                          +
                          1.  indented code
                             
                            @@ -3355,7 +3355,7 @@ src line: 4189 2. 3. bar . -
                              +
                              1. foo
                              2. bar
                              3. @@ -3400,7 +3400,7 @@ src line: 4236 > A block quote. . -
                                  +
                                  1. A paragraph with two lines.

                                    @@ -3424,7 +3424,7 @@ src line: 4260 > A block quote. . -
                                      +
                                      1. A paragraph with two lines.

                                        @@ -3448,7 +3448,7 @@ src line: 4284 > A block quote. . -
                                          +
                                          1. A paragraph with two lines.

                                            @@ -3492,7 +3492,7 @@ with two lines. > A block quote. . -
                                              +
                                              1. A paragraph with two lines.

                                                @@ -3512,7 +3512,7 @@ src line: 4362 1. A paragraph with two lines. . -
                                                  +
                                                  1. A paragraph with two lines.
                                                  @@ -3526,7 +3526,7 @@ src line: 4375 continued here. .
                                                  -
                                                    +
                                                    1. Blockquote @@ -3545,7 +3545,7 @@ src line: 4392 > continued here. .

                                                      -
                                                        +
                                                        1. Blockquote @@ -3651,7 +3651,7 @@ src line: 4506 . 1. - 2. foo . -

                                                            +
                                                              • @@ -3708,7 +3708,7 @@ src line: 4777 2. bar 3) baz . -
                                                                  +
                                                                  1. foo
                                                                  2. bar
                                                                  @@ -3751,7 +3751,7 @@ The number of windows in my house is 1. The number of doors is 6. .

                                                                  The number of windows in my house is

                                                                  -
                                                                    +
                                                                    1. The number of doors is 6.
                                                                    . @@ -3895,7 +3895,7 @@ src line: 5018 3. c . -
                                                                      +
                                                                      1. a

                                                                      2. @@ -4123,7 +4123,7 @@ src line: 5250 bar . -
                                                                          +
                                                                          1. foo
                                                                             
                                                                            diff --git a/test/fixtures/markdown-it/commonmark_extras.txt b/test/fixtures/markdown-it/commonmark_extras.txt index 3851a5d..2465030 100644 --- a/test/fixtures/markdown-it/commonmark_extras.txt +++ b/test/fixtures/markdown-it/commonmark_extras.txt @@ -380,7 +380,7 @@ Coverage. Tabs in lists. bar . -
                                                                              +
                                                                              1. foo

                                                                                 bar