From 40c2bbdcf3f93d1dea292e3774f1366813731357 Mon Sep 17 00:00:00 2001 From: Tinmarino Date: Thu, 22 Jun 2023 18:36:18 -0400 Subject: [PATCH] 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 --- autoload/vimwiki/html.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index eae47a3..0e9f464 100644 --- 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