Fix: Vimwiki2HTMLBrowse broken when using a custom converter (Issue #992)
This commit is contained in:
		@@ -1790,23 +1790,23 @@ function! s:convert_file(path_html, wikifile) abort
 | 
				
			|||||||
  let done = 0
 | 
					  let done = 0
 | 
				
			||||||
  let wikifile = fnamemodify(a:wikifile, ':p')
 | 
					  let wikifile = fnamemodify(a:wikifile, ':p')
 | 
				
			||||||
  let path_html = expand(a:path_html).vimwiki#vars#get_bufferlocal('subdir')
 | 
					  let path_html = expand(a:path_html).vimwiki#vars#get_bufferlocal('subdir')
 | 
				
			||||||
 | 
					  let htmlfile = fnamemodify(wikifile, ':t:r').'.html'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if s:use_custom_wiki2html()
 | 
					  if s:use_custom_wiki2html()
 | 
				
			||||||
    let force = 1
 | 
					    let force = 1
 | 
				
			||||||
    call vimwiki#html#CustomWiki2HTML(path_html, wikifile, force)
 | 
					    call vimwiki#html#CustomWiki2HTML(path_html, wikifile, force)
 | 
				
			||||||
    let done = 1
 | 
					    let done = 1
 | 
				
			||||||
    return ''
 | 
					    return path_html . htmlfile
 | 
				
			||||||
  endif
 | 
					  endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if s:syntax_supported() && done == 0
 | 
					  if s:syntax_supported() && done == 0
 | 
				
			||||||
    let htmlfile = fnamemodify(wikifile, ':t:r').'.html'
 | 
					 | 
				
			||||||
    let html_lines = s:convert_file_to_lines_template(wikifile, path_html . htmlfile)
 | 
					    let html_lines = s:convert_file_to_lines_template(wikifile, path_html . htmlfile)
 | 
				
			||||||
    if html_lines == []
 | 
					    if html_lines == []
 | 
				
			||||||
      return ''
 | 
					      return ''
 | 
				
			||||||
    endif
 | 
					    endif
 | 
				
			||||||
    call vimwiki#path#mkdir(path_html)
 | 
					    call vimwiki#path#mkdir(path_html)
 | 
				
			||||||
    call writefile(html_lines, path_html.htmlfile)
 | 
					    call writefile(html_lines, path_html.htmlfile)
 | 
				
			||||||
    return path_html.htmlfile
 | 
					    return path_html . htmlfile
 | 
				
			||||||
  endif
 | 
					  endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  call vimwiki#u#error('Conversion to HTML is not supported for this syntax')
 | 
					  call vimwiki#u#error('Conversion to HTML is not supported for this syntax')
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -158,7 +158,7 @@ setlocal formatoptions-=r
 | 
				
			|||||||
setlocal formatoptions-=o
 | 
					setlocal formatoptions-=o
 | 
				
			||||||
setlocal formatoptions-=2
 | 
					setlocal formatoptions-=2
 | 
				
			||||||
setlocal formatoptions+=n
 | 
					setlocal formatoptions+=n
 | 
				
			||||||
" Used to join blockquotes (see: #915)
 | 
					" Used to join 'commented' lines (blockquote, list) (see: #915)
 | 
				
			||||||
if v:version > 703
 | 
					if v:version > 703
 | 
				
			||||||
  setlocal formatoptions+=j
 | 
					  setlocal formatoptions+=j
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user