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

Support markdown multi-line highlight for constructs with inline-content #847

Closed
ubitux opened this issue Apr 5, 2020 · 9 comments
Closed

Comments

@ubitux
Copy link
Contributor

ubitux commented Apr 5, 2020

According to latest CommonMark spec as of 0.29 (https://spec.commonmark.org/0.29/#example-635), the following example should be highlighted:

*hello
world*

With Vimwiki, the conceal is not effective here, which hints me that the highlight is not set (would be nice to have a different color for this markup by default).

Similarly, the following doesn't work (which is the one I use since it displays in a different color, even though the semantic is most of the time not correct):

`hello
world`

Note that the spec says "Line breaks do not occur inside code spans", but this is only referring to the multi-line rendering: if you look at the output, it will still consider the whole thing as inline-code (ignoring the line break).

I use the gq command a lot, and thus the markup regularly breaks because of auto inserted line-breaks within highlighted sentences / word-groups.

Note: this issue is likely a good candidate for #664.

:VimwikiShowVersion:

Branch: dev
Revision: 78a41b7
Date: 2020-04-03 13:31:36 -0600

The issue is also reproducible with master.

@tinmarino
Copy link
Member

Feel free to make a PR. You can get it done in 2h.

@tinmarino tinmarino mentioned this issue Aug 1, 2020
5 tasks
@chipsenkbeil
Copy link
Member

@tinmarino, is this just syntax highlighting for these or is there extra logic to do?

If it's just syntax highlighting, then we could pop in a syntax region ... for each of these cases. Is the markdown supported by vimwiki following the commonmark spec? I don't actually know which flavor of markdown is used.

@ubitux
Copy link
Contributor Author

ubitux commented Aug 1, 2020

Speaking of this multi-line highlight not supported, there is a similar issue when using let g:vimwiki_hl_cb_checked = 1; if you have a multi line entry, only the first line gets highlighted when it's checked:

- [x] hello
      world

(multiline is actually kind of supported, because when under "world", o will add a list entry, and ctrl-space works to toggle the entry as well)

I can open another issue if needed.

@tinmarino
Copy link
Member

@chipsenkbeil

@tinmarino, is this just syntax highlighting for these or is there extra logic to do?

According to the issue creator, it is just syntax highliting, for me too. But this may break the html conversion that is done line by line.
I never looked at html conversion, but a multiple line stuff is what you've just done that is why I called for your power.

@ubitux

I can open another issue if needed.

Yes it would be better: Small issues are easier to close. So it divides better the dev workflow. Please:

  1. Link to this issue
  2. Explain very well the issue, so that the dev can implement non-regression tests from the description

@tinmarino
Copy link
Member

@ubitux before opening a new issue, check if that answer solves it (found searching multiline in issues and PR):

Try let g:vimwiki_hl_cb_checked=2. Admittedly, the doc is a bit inaccurate here.

@tinmarino
Copy link
Member

@chipsenkbeil yes it would be better as a region as tim pope is doing in the default markdown syntax : it is much cleaerer

tinmarino added a commit to tinmarino/vimwiki that referenced this issue Aug 2, 2020
…iki#847, vimwiki#640)

- Less code, Easyer to maintain, to add a markup language
- Faster to load, and to highlight
- Support multiline tags: vimwiki#847
- Support nested tags
- Support intraword tags: this<b>bold</b>type vimwiki#640
tinmarino added a commit to tinmarino/vimwiki that referenced this issue Aug 2, 2020
…iki#847, vimwiki#640)

- Less code, Easyer to maintain, to add a markup language
- Faster to load, and to highlight
- Support multiline tags: vimwiki#847
- Support nested tags
- Support intraword tags: this<b>bold</b>type vimwiki#640
@tinmarino
Copy link
Member

tinmarino commented Aug 2, 2020

Fixed: (1b16720 or search "Typeface" in commit title or Last commit refering this issue)

The syntax are redefined as regions which permited to solve this (see $VIMRUNTIME/wiki/markdown.vim from tim Pope)
This permited to solve this issue and #640 (receiving the same comment)

@tinmarino tinmarino reopened this Aug 2, 2020
@tinmarino
Copy link
Member

Ok this one is not finished:
TODO:

`hello
world`

@tinmarino
Copy link
Member

Closed in favor of #709 for the "inline" code than spam multiple line (for easyer tracking)

Thanks @ubitux for your very descriptive issues.

deepredsky pushed a commit to deepredsky/vimwiki that referenced this issue Jan 16, 2021
…iki#847, vimwiki#640)

- Less code, Easyer to maintain, to add a markup language
- Faster to load, and to highlight
- Support multiline tags: vimwiki#847
- Support nested tags
- Support intraword tags: this<b>bold</b>type vimwiki#640
jls83 pushed a commit to jls83/vimwiki that referenced this issue Jan 17, 2023
…iki#847, vimwiki#640)

- Less code, Easyer to maintain, to add a markup language
- Faster to load, and to highlight
- Support multiline tags: vimwiki#847
- Support nested tags
- Support intraword tags: this<b>bold</b>type vimwiki#640
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants