Vimwiki2HTML: remove string concat from variable substitution (#1110)
Problem: I noticed that running :Vimwiki2HTML for a file with a `"` in
the `%title` line would error out. For example, a title like:
%title this will die: "
Causes:
Error detected while processing function vimwiki#html#Wiki2HTML[1]..<SNR>177_convert_file[15]..<SNR>177_convert_file_to_lines
_template:
line 8:
E116: Invalid arguments for function substitute(v:val, "%title%", "this will die: "", "g")
Solution: It seems like the string concatenation here was unnecessary.
At least on my vim 8.1, the evaluated code seems to have access to the
correct variables.
I'm sure there are bigger problems with the HTML generation here, but this
allows my ~2000 pages with titles to render without throwing errors.
Also adds a brief test and removes some unnecessary DeleteFile() calls
from html_convert_default.vader.
Co-authored-by: Brennen Bearnes <code@p1k3.com>
This commit is contained in:
@@ -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('<title>this is a title with some quotes in it: '' "</title>')
|
||||
Reference in New Issue
Block a user