From 36fcb01e05979b410da1dcee10979b0f4e610eb6 Mon Sep 17 00:00:00 2001 From: Jesse Hathaway Date: Sun, 4 Jul 2021 07:39:29 -0500 Subject: Add pandoc as a markdown fixer (#3641) Utilize pandoc to fix markdown files, currently set to Github-Flavored Markdown, but that can be changed by setting, ale_markdown_pandoc_options. --- test/fixers/test_pandoc_fixer_callback.vader | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/fixers/test_pandoc_fixer_callback.vader (limited to 'test/fixers') diff --git a/test/fixers/test_pandoc_fixer_callback.vader b/test/fixers/test_pandoc_fixer_callback.vader new file mode 100644 index 00000000..a364ee56 --- /dev/null +++ b/test/fixers/test_pandoc_fixer_callback.vader @@ -0,0 +1,23 @@ +Before: + Save g:ale_markdown_pandoc_executable + Save g:ale_markdown_pandoc_options + +After: + Restore + +Execute(The pandoc callback should return 'pandoc' as default command): + setlocal noexpandtab + Assert + \ ale#fixers#pandoc#Fix(bufnr('')).command =~# '^' . ale#Escape('pandoc'), + \ "Default command name is expected to be 'pandoc'" + +Execute(The pandoc executable and options should be configurable): + let g:ale_markdown_pandoc_executable = 'foobar' + let g:ale_markdown_pandoc_options = '--some-option' + + AssertEqual + \ { + \ 'command': ale#Escape('foobar') + \ . ' --some-option', + \ }, + \ ale#fixers#pandoc#Fix(bufnr('')) -- cgit v1.2.3