Added config option to allow for newlines in text when exporting to HTML

This commit is contained in:
Michael Thessel 2017-01-05 22:01:48 -08:00
parent 3a87437005
commit 8507c95716
3 changed files with 19 additions and 1 deletions

View File

@ -979,7 +979,11 @@ function! s:process_tag_para(line, para) "{{{
let para = 1 let para = 1
endif endif
let processed = 1 let processed = 1
if g:vimwiki_text_ignore_newline == 1
call add(lines, a:line) call add(lines, a:line)
else
call add(lines, a:line."<br />")
endif
elseif para && a:line =~# '^\s*$' elseif para && a:line =~# '^\s*$'
call add(lines, "</p>") call add(lines, "</p>")
let para = 0 let para = 0

View File

@ -2302,6 +2302,19 @@ Value Description~
Default: 1 Default: 1
------------------------------------------------------------------------------
*g:vimwiki_text_ignore_newline*
This is HTML related.
Convert newlines to <br />s in text.
Value Description~
0 Newlines in text are converted to <br />s.
1 Ignore newlines.
Default: 1
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*g:vimwiki_use_calendar* *g:vimwiki_use_calendar*

View File

@ -369,6 +369,7 @@ call s:default('ext2syntax', {}) " syntax map keyed on extension
call s:default('hl_headers', 0) call s:default('hl_headers', 0)
call s:default('hl_cb_checked', 0) call s:default('hl_cb_checked', 0)
call s:default('list_ignore_newline', 1) call s:default('list_ignore_newline', 1)
call s:default('text_ignore_newline', 1)
call s:default('listsyms', ' .oOX') call s:default('listsyms', ' .oOX')
call s:default('use_calendar', 1) call s:default('use_calendar', 1)
call s:default('table_mappings', 1) call s:default('table_mappings', 1)