Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VimwikiBacklinks doesn't see wiki-style [[links]] when using markdown syntax #1244

Closed
nebulaeandstars opened this issue Jun 22, 2022 · 8 comments
Labels
link Related to link and path creation, modification, use [See #478] markdown Problems specific to markdown syntax

Comments

@nebulaeandstars
Copy link

tl;dr: VimwikiBacklinks can recognise [normal-links](normal-links), but not [[wiki-style-links]]. Given that vimwiki seems to support both formats, I assume this is a bug.

  • expected behaviour: both forms of link should be counted as a backlink.
  • actual behaviour: only [markdown-style links](some-other-note) are detected.
  • bug is present in the latest versions of both dev and master.

vimwiki config:

let g:vimwiki_list = [{
            \'path': '~/docs/notes/',
            \'path_html': '~/docs/notes/html',
            \'syntax': 'markdown',
            \'ext': '.md',
            \}]

let g:vimwiki_table_mappings = 0
let g:vimwiki_global_ext = 0

Steps to reproduce:

  1. Make three files
  2. Add two links to the first file:
    • [second-file](second-file)
    • [[third-file]]
  3. Follow the links and test using :VWB
    • the second file will have a backlink to the first
    • the third file will not
@nebulaeandstars
Copy link
Author

nebulaeandstars commented Jun 22, 2022

After some digging around, it looks like vim-zettel might have a working implementation, but I haven't spent much time trying to figure out how it works.

@nebulaeandstars
Copy link
Author

I'm not that familiar with vimscript, but I've made an MR for this, as it ended up being a fairly quick fix

@brennen brennen added markdown Problems specific to markdown syntax link Related to link and path creation, modification, use [See #478] labels Jun 22, 2022
@fcsm1922
Copy link

fcsm1922 commented Jul 4, 2022

@nebulaeandstars,

I'm not that familiar with vimscript, but I've made an MR for this, as it ended up being a fairly quick fix

Hi.Please tell me how you solved this problem?

@nebulaeandstars
Copy link
Author

nebulaeandstars commented Jul 4, 2022

I just changed a small part of the function that generates the list of links.

Before it was saying "If in markdown mode, count markdown links, otherwise count wiki links."

Now it says "Count wiki links. If in markdown mode, also count markdown links."

Pull request is here. It doesn't like it can merge anymore, though.

@fcsm1922
Copy link

fcsm1922 commented Jul 4, 2022

@nebulaeandstars,

did you change this in the base.vim file?
could you post your file? so as not to make mistakes when changing))

@fcsm1922
Copy link

fcsm1922 commented Jul 4, 2022

made changes to the file ~/.vim/bundle/vimwiki/autoload/vimwiki/base.vim that you made.... and nothing..
and yes... the base.vim file is smaller for some reason (by the number of lines of code)

in the created vimwiki directory
[[folder/filename]]
when converting index.md to html file index.html outputs
[[folder/filename]] instead of a link to a file located in folder

explanation:

[[create folder/create file|file description]]

convert to html

[[create folder/create file|file description]] is rendered in index.html as follows. instead of following the file description link

VimwikiShowVersion: stable 2.5

Update:

I sort of figured it out. create such folders [index.md file description](creation folder/file name) and everything works.

but it's unclear why the number of lines in base.vim is less than on the website...

Thanks!

@lumpsoid
Copy link

@fcsm1922
you can use the fzf plugin for vim on this purpose, just take search by the name (id) of your file

@brennen
Copy link
Member

brennen commented Jul 18, 2022

Should be resolved with application of 3ac8e1a.

@brennen brennen closed this as completed Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
link Related to link and path creation, modification, use [See #478] markdown Problems specific to markdown syntax
Projects
None yet
Development

No branches or pull requests

4 participants