summaryrefslogtreecommitdiff
path: root/src/input_handler.hh
diff options
context:
space:
mode:
authorTim Allen <screwtape@froup.com>2017-08-01 20:36:40 +1000
committerTim Allen <screwtape@froup.com>2017-08-01 20:36:40 +1000
commite640e6d8591a4a10a3ed9a23b90c215e288f7032 (patch)
tree0033c48257ebb88730472a5f9b80fb878113e861 /src/input_handler.hh
parent8a6df93dc629f7bff858f4b5bc34054b3b4efb33 (diff)
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.
Diffstat (limited to 'src/input_handler.hh')
0 files changed, 0 insertions, 0 deletions