diff --git a/rc/base/markdown.kak b/rc/base/markdown.kak index 3eaa77a3..8d50cad8 100644 --- a/rc/base/markdown.kak +++ b/rc/base/markdown.kak @@ -127,7 +127,7 @@ add-highlighter -group /markdown/content regex \H\K\h\h$ 0:PrimarySelection def -hidden markdown-indent-on-new-line %{ eval -draft -itersel %{ # copy block quote(s), list item prefix and following white spaces - try %{ exec -draft k s ^\h*\K((>\h*)|[*+-])+\h* y gh j P } + try %{ exec -draft k s ^\h*\K((>\h*)+([*+-]\h)?|(>\h*)*[*+-]\h)\h* y gh j P } # preserve previous line indent try %{ exec -draft \; K } # remove trailing white spaces diff --git a/test/indent/markdown/inside-complex-blockquote/cmd b/test/indent/markdown/inside-complex-blockquote/cmd new file mode 100644 index 00000000..54aed4f8 --- /dev/null +++ b/test/indent/markdown/inside-complex-blockquote/cmd @@ -0,0 +1 @@ +i diff --git a/test/indent/markdown/inside-complex-blockquote/in b/test/indent/markdown/inside-complex-blockquote/in new file mode 100644 index 00000000..a79d2516 --- /dev/null +++ b/test/indent/markdown/inside-complex-blockquote/in @@ -0,0 +1 @@ +>> > > block %(q)uote diff --git a/test/indent/markdown/inside-complex-blockquote/out b/test/indent/markdown/inside-complex-blockquote/out new file mode 100644 index 00000000..be4f1e99 --- /dev/null +++ b/test/indent/markdown/inside-complex-blockquote/out @@ -0,0 +1,2 @@ +>> > > block +>> > > quote diff --git a/test/indent/markdown/inside-complex-blockquote/rc b/test/indent/markdown/inside-complex-blockquote/rc new file mode 100644 index 00000000..7b9ff85e --- /dev/null +++ b/test/indent/markdown/inside-complex-blockquote/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/base/markdown.kak" +set buffer filetype markdown diff --git a/test/indent/markdown/inside-nested-list-item/cmd b/test/indent/markdown/inside-nested-list-item/cmd new file mode 100644 index 00000000..74a4df63 --- /dev/null +++ b/test/indent/markdown/inside-nested-list-item/cmd @@ -0,0 +1 @@ +a diff --git a/test/indent/markdown/inside-nested-list-item/in b/test/indent/markdown/inside-nested-list-item/in new file mode 100644 index 00000000..a3a2e3ed --- /dev/null +++ b/test/indent/markdown/inside-nested-list-item/in @@ -0,0 +1,2 @@ + - parent + * some%( )child diff --git a/test/indent/markdown/inside-nested-list-item/out b/test/indent/markdown/inside-nested-list-item/out new file mode 100644 index 00000000..73b7f06d --- /dev/null +++ b/test/indent/markdown/inside-nested-list-item/out @@ -0,0 +1,3 @@ + - parent + * some + * child diff --git a/test/indent/markdown/inside-nested-list-item/rc b/test/indent/markdown/inside-nested-list-item/rc new file mode 100644 index 00000000..7b9ff85e --- /dev/null +++ b/test/indent/markdown/inside-nested-list-item/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/base/markdown.kak" +set buffer filetype markdown diff --git a/test/indent/markdown/inside-simple-blockquote/cmd b/test/indent/markdown/inside-simple-blockquote/cmd new file mode 100644 index 00000000..54aed4f8 --- /dev/null +++ b/test/indent/markdown/inside-simple-blockquote/cmd @@ -0,0 +1 @@ +i diff --git a/test/indent/markdown/inside-simple-blockquote/in b/test/indent/markdown/inside-simple-blockquote/in new file mode 100644 index 00000000..8b77eb68 --- /dev/null +++ b/test/indent/markdown/inside-simple-blockquote/in @@ -0,0 +1 @@ +> block %(q)uote diff --git a/test/indent/markdown/inside-simple-blockquote/out b/test/indent/markdown/inside-simple-blockquote/out new file mode 100644 index 00000000..d286b922 --- /dev/null +++ b/test/indent/markdown/inside-simple-blockquote/out @@ -0,0 +1,2 @@ +> block +> quote diff --git a/test/indent/markdown/inside-simple-blockquote/rc b/test/indent/markdown/inside-simple-blockquote/rc new file mode 100644 index 00000000..7b9ff85e --- /dev/null +++ b/test/indent/markdown/inside-simple-blockquote/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/base/markdown.kak" +set buffer filetype markdown diff --git a/test/indent/markdown/inside-strong-emphasis/cmd b/test/indent/markdown/inside-strong-emphasis/cmd new file mode 100644 index 00000000..54aed4f8 --- /dev/null +++ b/test/indent/markdown/inside-strong-emphasis/cmd @@ -0,0 +1 @@ +i diff --git a/test/indent/markdown/inside-strong-emphasis/in b/test/indent/markdown/inside-strong-emphasis/in new file mode 100644 index 00000000..1f6d4b18 --- /dev/null +++ b/test/indent/markdown/inside-strong-emphasis/in @@ -0,0 +1 @@ +**strong %(e)mphasis** diff --git a/test/indent/markdown/inside-strong-emphasis/out b/test/indent/markdown/inside-strong-emphasis/out new file mode 100644 index 00000000..3c878b78 --- /dev/null +++ b/test/indent/markdown/inside-strong-emphasis/out @@ -0,0 +1,2 @@ +**strong +emphasis** diff --git a/test/indent/markdown/inside-strong-emphasis/rc b/test/indent/markdown/inside-strong-emphasis/rc new file mode 100644 index 00000000..7b9ff85e --- /dev/null +++ b/test/indent/markdown/inside-strong-emphasis/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/base/markdown.kak" +set buffer filetype markdown diff --git a/test/indent/markdown/open-after-setext-heading-1/cmd b/test/indent/markdown/open-after-setext-heading-1/cmd new file mode 100644 index 00000000..13e7564e --- /dev/null +++ b/test/indent/markdown/open-after-setext-heading-1/cmd @@ -0,0 +1 @@ +o diff --git a/test/indent/markdown/open-after-setext-heading-1/in b/test/indent/markdown/open-after-setext-heading-1/in new file mode 100644 index 00000000..82cbbec9 --- /dev/null +++ b/test/indent/markdown/open-after-setext-heading-1/in @@ -0,0 +1,2 @@ +Some Heading +%(=)=========== diff --git a/test/indent/markdown/open-after-setext-heading-1/out b/test/indent/markdown/open-after-setext-heading-1/out new file mode 100644 index 00000000..24c996b3 --- /dev/null +++ b/test/indent/markdown/open-after-setext-heading-1/out @@ -0,0 +1,3 @@ +Some Heading +============ + diff --git a/test/indent/markdown/open-after-setext-heading-1/rc b/test/indent/markdown/open-after-setext-heading-1/rc new file mode 100644 index 00000000..7b9ff85e --- /dev/null +++ b/test/indent/markdown/open-after-setext-heading-1/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/base/markdown.kak" +set buffer filetype markdown diff --git a/test/indent/markdown/open-after-setext-heading-2/cmd b/test/indent/markdown/open-after-setext-heading-2/cmd new file mode 100644 index 00000000..13e7564e --- /dev/null +++ b/test/indent/markdown/open-after-setext-heading-2/cmd @@ -0,0 +1 @@ +o diff --git a/test/indent/markdown/open-after-setext-heading-2/in b/test/indent/markdown/open-after-setext-heading-2/in new file mode 100644 index 00000000..831d9d37 --- /dev/null +++ b/test/indent/markdown/open-after-setext-heading-2/in @@ -0,0 +1,2 @@ +Some Heading +%(-)----------- diff --git a/test/indent/markdown/open-after-setext-heading-2/out b/test/indent/markdown/open-after-setext-heading-2/out new file mode 100644 index 00000000..4ff5ae19 --- /dev/null +++ b/test/indent/markdown/open-after-setext-heading-2/out @@ -0,0 +1,3 @@ +Some Heading +------------ + diff --git a/test/indent/markdown/open-after-setext-heading-2/rc b/test/indent/markdown/open-after-setext-heading-2/rc new file mode 100644 index 00000000..7b9ff85e --- /dev/null +++ b/test/indent/markdown/open-after-setext-heading-2/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/base/markdown.kak" +set buffer filetype markdown