diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index e223297..b075bdd 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -1831,25 +1831,25 @@ function! s:convert_file_to_lines_template(wikifile, current_html_file) abort let html_lines = s:get_html_template(converted['template_name']) " processing template variables (refactor to a function) - call map(html_lines, 'substitute(v:val, "%title%", "'. converted['title'] .'", "g")') - call map(html_lines, 'substitute(v:val, "%date%", "'. converted['date'] .'", "g")') + call map(html_lines, 'substitute(v:val, "%title%", converted["title"], "g")') + call map(html_lines, 'substitute(v:val, "%date%", converted["date"], "g")') call map(html_lines, 'substitute(v:val, "%root_path%", "'. \ s:root_path(vimwiki#vars#get_bufferlocal('subdir')) .'", "g")') - call map(html_lines, 'substitute(v:val, "%wiki_path%", "'. converted['wiki_path'] .'", "g")') + call map(html_lines, 'substitute(v:val, "%wiki_path%", converted["wiki_path"], "g")') let css_name = expand(vimwiki#vars#get_wikilocal('css_name')) let css_name = substitute(css_name, '\', '/', 'g') - call map(html_lines, 'substitute(v:val, "%css%", "'. css_name .'", "g")') + call map(html_lines, 'substitute(v:val, "%css%", css_name, "g")') let rss_name = expand(vimwiki#vars#get_wikilocal('rss_name')) let rss_name = substitute(rss_name, '\', '/', 'g') - call map(html_lines, 'substitute(v:val, "%rss%", "'. rss_name .'", "g")') + call map(html_lines, 'substitute(v:val, "%rss%", rss_name, "g")') let enc = &fileencoding if enc ==? '' let enc = &encoding endif - call map(html_lines, 'substitute(v:val, "%encoding%", "'. enc .'", "g")') + call map(html_lines, 'substitute(v:val, "%encoding%", enc, "g")') let html_lines = s:html_insert_contents(html_lines, converted['html']) " %contents% diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 681498b..f3f2ec1 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -3955,6 +3955,7 @@ Changed:~ Removed:~ Fixed:~ + * Allow title values with quotes * Enable strikethrough for Neovim * Issue #1029: Fix: error loading plugin when lang uses comma instead of dot as decimal separator diff --git a/test/html_convert_default.vader b/test/html_convert_default.vader index 90166a5..d9d57d4 100644 --- a/test/html_convert_default.vader +++ b/test/html_convert_default.vader @@ -1,4 +1,4 @@ -# Conertion: Wiki -> Html +# Conversion: Wiki -> Html ################################################# Given vimwiki (Comments): @@ -43,10 +43,6 @@ Expect (Comments Removed): -Execute(Delete): - call DeleteFile('$HOME/testwiki/test_html_table.wiki') - call DeleteFile('$HOME/html/default/test_html_table.html') - ################################################# Given vimwiki (Table no heading {{{1): | header1 | header2 | @@ -101,10 +97,6 @@ Expect (Table no heading): -Execute(Delete): - call DeleteFile('$HOME/testwiki/test_html_table.wiki') - call DeleteFile('$HOME/html/default/test_html_table.html') - Given vimwiki (Table with heading {{{1): | header1 | header2 | header3 | @@ -165,10 +157,6 @@ Expect (Table with heading): -Execute(Delete): - call DeleteFile('$HOME/testwiki/test_html_table.wiki') - call DeleteFile('$HOME/html/default/test_html_table.html') - ################################################# Execute (Log): Log '#473: Syntax "local:" doesnt work as expected. #473' diff --git a/test/html_convert_title.vader b/test/html_convert_title.vader new file mode 100644 index 0000000..31288f2 --- /dev/null +++ b/test/html_convert_title.vader @@ -0,0 +1,10 @@ +# Test that %title values carry through when HTML is rendered + +Given vimwiki (Title value): + %title this is a title with some quotes in it: ' " + + Some content. + +Execute(Check for title tag): + call ConvertWiki2Html() + Assert 0 != search('this is a title with some quotes in it: '' "')