commit 40c2bbdcf3f93d1dea292e3774f1366813731357
parent e0a04e11b8182e0086af902b7a62916565cf4791
Author: Tinmarino <tinmarino@gmail.com>
Date: Thu, 22 Jun 2023 18:36:18 -0400
Fix: HTML convertion for code is stripping newlines (issue #1311)
Initially titled: Can't enable syntax highlighting for codes in HTML files when converting wiki to HTML
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim
@@ -1898,12 +1898,12 @@ function! s:convert_file(path_html, wikifile) abort
endwhile
let tmp = ('tmp'. split(system('mktemp -p . --suffix=.' . type, 'silent'), 'tmp')[-1])[:-2]
- call system('echo ' . shellescape(join(html_lines[start : cur - 1], '\n')) . ' > ' . tmp)
+ call system('echo ' . shellescape(join(html_lines[start : cur - 1], "\n")) . ' > ' . tmp)
call system(g:vimwiki_global_vars['listing_hl_command'] . ' ' . tmp . ' > ' . tmp . '.html')
let html_out = system('cat ' . tmp . '.html')
call system('rm ' . tmp . ' ' . tmp . '.html')
let i = cur
- let html_lines = html_lines[0 : start - 1] + split(html_out, '\n') + html_lines[cur : ]
+ let html_lines = html_lines[0 : start - 1] + split(html_out, "\n") + html_lines[cur : ]
endif
let i += 1
endwhile