From 8507c9571680882e1e808ac251cba2d5562e0b4f Mon Sep 17 00:00:00 2001 From: Michael Thessel Date: Thu, 5 Jan 2017 22:01:48 -0800 Subject: [PATCH] Added config option to allow for newlines in text when exporting to HTML --- autoload/vimwiki/html.vim | 6 +++++- doc/vimwiki.txt | 13 +++++++++++++ plugin/vimwiki.vim | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index 584985f..a35e422 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -979,7 +979,11 @@ function! s:process_tag_para(line, para) "{{{ let para = 1 endif let processed = 1 - call add(lines, a:line) + if g:vimwiki_text_ignore_newline == 1 + call add(lines, a:line) + else + call add(lines, a:line."
") + endif elseif para && a:line =~# '^\s*$' call add(lines, "

") let para = 0 diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 9cc5dd9..08cf581 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2302,6 +2302,19 @@ Value Description~ Default: 1 +------------------------------------------------------------------------------ +*g:vimwiki_text_ignore_newline* + +This is HTML related. +Convert newlines to
s in text. + +Value Description~ +0 Newlines in text are converted to
s. +1 Ignore newlines. + +Default: 1 + + ------------------------------------------------------------------------------ *g:vimwiki_use_calendar* diff --git a/plugin/vimwiki.vim b/plugin/vimwiki.vim index d7abb6c..ddb4b35 100644 --- a/plugin/vimwiki.vim +++ b/plugin/vimwiki.vim @@ -369,6 +369,7 @@ call s:default('ext2syntax', {}) " syntax map keyed on extension call s:default('hl_headers', 0) call s:default('hl_cb_checked', 0) call s:default('list_ignore_newline', 1) +call s:default('text_ignore_newline', 1) call s:default('listsyms', ' .oOX') call s:default('use_calendar', 1) call s:default('table_mappings', 1)