vimwiki icon indicating copy to clipboard operation
vimwiki copied to clipboard

Links with anchors not properly converted in .hmtl files

Open joaoandreporto opened this issue 3 years ago • 0 comments

Hi,

I couldn’t completely fathom if this was listed in #664, or already under development, so if ¬("not"), i’m sorry, my bad.


  • [x] Checkout the dev branch and confirm the issue is present there as well. The dev branch contains fixes that may not have been merged to master yet.

Not 100% sure...


  • [x] Post the syntax you are using (default/mediawiki/markdown) and your vimwiki settings from your .vimrc
“” Code layout
" Vimwiki/Markdown                    
au BufNewFile,BufRead *.wiki,*.md     
    \ call s:SetSpell('pt_en') |      
    \ setlocal cursorlineopt=number | 
    \ setlocal filetype=vimwiki |     
    \ setlocal tabstop=4 |            
    \ setlocal softtabstop=4 |        
    \ setlocal shiftwidth=4 |         
    \ setlocal shiftround |           
    \ setlocal textwidth=79 |         
    \ setlocal expandtab |            
    \ setlocal autoindent |           
    \ setlocal fileformat=unix |      

“” General
let g:vimwiki_list = [{                                                      
                \ 'auto_export': 1,                                          
                \ 'automatic_nested_syntaxes': 1,                            
                \ 'path': '/Users/Shared/vimwiki/foowiki/',                   
                \ 'syntax': 'markdown',                                      
                \ 'ext': '.md',                                              
                \ 'path_html': '/Users/Shared/vimwiki/foowiki_html/',         
                \ 'custom_wiki2html': 'vimwiki_markdown',                    
                \ 'template_path': '/Users/Shared/vimwiki/foowiki_templates/',
                \ 'template_default': 'default',                             
                \ 'template_ext': '.tpl'}]                                   
                                                                   
"" Newlines                                         
let g:vimwiki_list_ignore_newline = 0                                        
let g:vimwiki_text_ignore_newline = 0                                        
                                                                             
"" Markdown                                                                  
let g:vimwiki_ext2syntax = {                                                 
                        \ '.md' : 'markdown',                                
                        \ '.markdown' : 'markdown',                          
                        \ '.mdown' : 'markdown'}                             
" add .md extension to wiki files                                            
let g:vimwiki_markdown_link_ext = 1                                          
" follow named anchors in links                                              
let g:vim_markdown_follow_anchor = 1                                         
" enable markdown TOC window auto-fit                                        
let g:vim_markdown_toc_autofit = 1                                                                  
                                              
"" Folding                                                                   
let g:vimwiki_folding=''                                                     
" markdown folding makes vimwiki lag                                                    
let g:vim_markdown_folding_disabled = 1     

"" Other
" correct <TAB> behavior
let g:vimwiki_table_mappings = 0                                  

  • [x] Provide a detailed description of the problem including steps to reproduce the issue.

Upon conversion (from .md in this case) to .html, hyperlink paths with anchors resolve to e.g.:

file:///path/to/vimwiki/vimwiki_html/index#foo.html

instead of the expected:

file:///path/to/vimwiki/vimwiki_html/index.html#foo

this causes hyperlinks with anchors to not be followed, when navigating the .hmtl files.

steps to reproduce the issue:

On a new wiki...

  1. Create foo.md, with content:
# anchor1

## anchor2

## anchor3
  1. Create bar.md, with content:
[anchor3](path/to/foo#anchor3)
  1. Run :Vimwiki2HTML to convert the files to .html;

  2. Open bar.html and inspect the [anchor3] hyperlink.


  • [x] Include the output of :VimwikiShowVersion. Stable version: 2.5

joaoandreporto avatar Jul 27 '22 19:07 joaoandreporto