Skip to content

Indented lists have incorrect position #517

@cl8n

Description

@cl8n

Subject of the issue

Adding whitespace before a list doesn't change the position of the list or any of its items

context for how I came across this:

using this remark-lint config,

    ['lint-list-item-content-indent'],
    ['lint-list-item-indent', 'space'],

I was expecting list-item-content-indent to warn about the second ordered list in this example, since it's not aligned with the paragraph before it, and they both belong to a list item:

- Jika skin menggunakan `.osk`:
  1. Buka filenya atau seret dan lepaskan ke osu! yang sedang dijalankan.
  2. osu! akan memproses skin dan secara otomatis akan memilihnya untuk anda.
- Jika skin dikompresi (menggunakan `.7z`, `.rar`, `.zip`, dll.):
    1. Extract filenya.
    2. Pindahkan folder skin ke folder `Skins` di direktori osu!.
    3. Jika osu! sedang dijalankan, anda mungkin perlu memulai ulang sebelum skin dapat digunakan.
    4. Di osu!, pilih menu [Pengaturan](/wiki/Options) dan cari `Skin`.
    5. Gulir ke bawah ke opsi `Skin saat ini:` dan pilih skin yang telah anda unduh.

but it doesn't output any warnings. it turns out that both of the ordered lists have the same start columns, despite there being two extra spaces in front of the second one.

Steps to reproduce

Parse this list, note there's 1 space before it:

 1. test

Expected behaviour

The position of the list and the list item should start at 1:2

root[1] (1:1-1:9, 0-8)
└─ list[1] (1:2-1:9, 1-8) [ordered=true][start=1][spread=false]
   └─ listItem[1] (1:2-1:9, 1-8) [spread=false]
      └─ paragraph[1] (1:5-1:9, 4-8)
         └─ text: "test" (1:5-1:9, 4-8)

Actual behaviour

They start at 1:1 instead

root[1] (1:1-1:9, 0-8)
└─ list[1] (1:1-1:9, 0-8) [ordered=true][start=1][spread=false]
   └─ listItem[1] (1:1-1:9, 0-8) [spread=false]
      └─ paragraph[1] (1:5-1:9, 4-8)
         └─ text: "test" (1:5-1:9, 4-8)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions