Skip to content

Conversation

nkakouros
Copy link
Contributor

In the regexp that handle viewports, there is the restriction on header names to not include the ] or } characters. I couldn't see why this restriction is in place as the | is what actually matters.

This PR removes the restriction. It means to address #256 .

@liskin
Copy link
Collaborator

liskin commented Jul 21, 2020

The restriction is there because vimwiki links may contain |: https://github.com/vimwiki/vimwiki/blob/619f04f89861c58e5a6415a4f83847752928252d/doc/vimwiki.txt#L996

It's definitely possible to write a regexp that handles this, but it's going to be more complex than the current one. Several options come to my mind:

  1. keep the [^=\|\[\{]* and add an alternative that recognizes [[ and then eats everything until ]]
  2. use a negative look-ahead assertion (\@!) to make sure that the | isn't followed by ]]
  3. require spaces around the | as vimwiki links are unlikely to contain spaces around their |

The third option is definitely the easiest, but I have no idea if that would be acceptable to @tbabej. It's also the one that is most likely to break some users' usecases.

Either way, now that the tests are working and fast, it would be a good idea to add a few tests covering the various scenarios.

@tbabej tbabej force-pushed the master branch 9 times, most recently from b549521 to 36652d1 Compare September 18, 2020 06:19
@nkakouros
Copy link
Contributor Author

I went with the simplest approach.

@nkakouros
Copy link
Contributor Author

I also fixed markdown links not being followed. This is ready to merge if you have no comments.

@nkakouros
Copy link
Contributor Author

@tbabej Friendly reminder that this seems ready to merge.

tbabej added a commit that referenced this pull request Jun 14, 2025
This was also independently noted by Nikolaos Kakouros
@nkakouros in #271
tbabej added a commit that referenced this pull request Jun 14, 2025
…ike convention

This was also independently noted by Nikolaos Kakouros
@nkakouros in #271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants