kakoune/test/indent/markdown
Tim Allen e640e6d859 Consecutive markdown list bullets are not a valid list prefix.
Previously, if you opened a new line after an underlined heading (what
the CommonMark spec calls a "Setext heading") or inserted a newline into
a line that started with `**strong emphasis**` the Markdown autoindent
hook would assume the leading symbols were list bullets and paste them
at the beginning of the new line.

However, the CommonMark specification says that list bullets must be
followed by at least one horizontal whitespace character, so Setext
heading underlines and strong emphasis are not valid list bullets and
should not be matched by the autoindent pattern.

This commit changes the regex that selects the pastable prefix of the
previous line so that it must match either:

  - One or more `>` characters with optional whitespace between them
    (a blockquote prefix), optionally followed by a list bullet; or
  - An optional blockquote prefix and a list bullet

Since we don't strictly need either the blockquote prefix nor the list
bullet, we could concievably just make both optional... but for lines
without either, the regex would find a zero-length match, and for the
purposes of copy/paste Kakoune treats that as a one-character match.
Therefore, the regex is written to fail if neither pattern is found.
2017-08-01 20:36:40 +10:00
..
inside-complex-blockquote More tests for markdown autoindent. 2017-08-01 19:53:01 +10:00
inside-list-item
inside-nested-list-item More tests for markdown autoindent. 2017-08-01 19:53:01 +10:00
inside-simple-blockquote More tests for markdown autoindent. 2017-08-01 19:53:01 +10:00
inside-strong-emphasis Consecutive markdown list bullets are not a valid list prefix. 2017-08-01 20:36:40 +10:00
list-item
open-after-setext-heading-1 More tests for markdown autoindent. 2017-08-01 19:53:01 +10:00
open-after-setext-heading-2 Consecutive markdown list bullets are not a valid list prefix. 2017-08-01 20:36:40 +10:00