Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Conceal in md only conceals the first md element (md) #34

Open
21it opened this issue Mar 20, 2021 · 19 comments
Open

Conceal in md only conceals the first md element (md) #34

21it opened this issue Mar 20, 2021 · 19 comments

Comments

@21it
Copy link

21it commented Mar 20, 2021

This markdown

# Tables

| Last Name      | First Name | Born | Bacon Number |
|----------------|------------|------|--------------|
| Bacon          | Kevin      | 1958 | 0            |
| Chan           | Jackie     | 1954 | 2            |
| Reagan         | Ronald     | 1911 | 2            |
| Ryan           | Meg        | 1961 | 1            |
| Saldaña        | Zoë        | 1978 | 2            |
| Schwarzenegger | Arnold     | 1947 | 2            |
| Temple         | Shirley    | 1928 | 3            |

Renders as

                                                                          _____     _     _           
                                                                         |_   _|_ _| |__ | | ___  ___ 
                                                                           | |/ _` | '_ \| |/ _ \/ __|
                                                                           | | (_| | |_) | |  __/\__ \
                                                                           |_|\__,_|_.__/|_|\___||___/
                                                                                                      

«tr»                                                            ┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━┓
«th»                                                            ┃ Last Name      ┃ First Name ┃ Born ┃ Bacon Number ┃
«tr»                                                            ┣━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━╋━━━━━━━━━━━━━━┫
«tr»                                                            ┃ Bacon          ┃ Kevin      ┃ 1958 ┃ 0            ┃
«tr»                                                            ┃ Chan           ┃ Jackie     ┃ 1954 ┃ 2            ┃
«tr»                                                            ┃ Reagan         ┃ Ronald     ┃ 1911 ┃ 2            ┃
«tr»                                                            ┃ Ryan           ┃ Meg        ┃ 1961 ┃ 1            ┃
«tr»                                                            ┃ Saldaña        ┃ Zoë        ┃ 1978 ┃ 2            ┃
«tr»                                                            ┃ Schwarzenegger ┃ Arnold     ┃ 1947 ┃ 2            ┃
«tr»                                                            ┃ Temple         ┃ Shirley    ┃ 1928 ┃ 3            ┃
«tr»                                                            ┗━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━┻━━━━━━━━━━━━━━┛

@ckangnz
Copy link

ckangnz commented Mar 28, 2021

I also see this issue :(
image

@rohitvvv
Copy link

How to get rid of the tags that render on the left?

@sotte
Copy link
Owner

sotte commented May 14, 2021

#26 introduced the much nicer rendering of presentations (thanks again!), but it's not as robust as it should have been (my bad, I should have checked more).

I'll have some time this weekend and will check it out.

@f1se4
Copy link

f1se4 commented May 20, 2021

Hi,

I have cloned this respository to be able to be used in ‘ivim’ ios version of vim. By the way I have solved (or it works for me) tags issues with tables and headers.

Here you have the repository: https://github.com/f1se4/presenting_ivim.vim.git

And, really really love this. In an ipad-air where I’m using this it’s perfect way to have ‘geek’ presentation done in the best editor in less than any other tool I could imagine. Thank you,

@ckangnz
Copy link

ckangnz commented Jun 1, 2021

hey @sotte , has this been resolved? I just tried out the latest version but it still has the same issue :(

@sotte
Copy link
Owner

sotte commented Jun 2, 2021

@chris542 well, life happened :)

I did some investigation. The conceal feature does not work as intended.

The first conceal on a page/slide always works. It can be any heading or table!
E.g. if you have a md file like this the rendering/concealing works.

| Last Name      | First Name | Born | Bacon Number |
|----------------|------------|------|--------------|
| Bacon          | Kevin      | 1958 | 0            |
| Chan           | Jackie     | 1954 | 2            |

Did some research on conceal, but did not see anything obvious wrong. I'll have to investigate further.

(I also found some inconsistencies how figlet and not figlet headings are handled. I'll address this separately.)

@sotte
Copy link
Owner

sotte commented Jun 2, 2021

I checked out the version that is used in the animated gif d69d02b
Even with this version the conceal does not work properly (i.e only the first conceal works).

❯ git co d69d02b38832517836d0e8076883fdb4b63e9844
❯ vim examples/PresentingDemo.markdown +PresentingStart

image

@sotte
Copy link
Owner

sotte commented Jun 2, 2021

I checked out many versions and at least for my current setup (nvim v0.5) this feature never worked. I'm sure it did at some point though.

@PhilRunninger you implemented this feature. Can you check if conceal still works on your end? That would be great!

❯ nvim --version
NVIM v0.5.0-dev+1369-g64bdaef32
Build type: Release
LuaJIT 2.1.0-beta3

@sotte sotte changed the title tables, h3 and h4 rendering is broken Conceal in md only conceals the first md element (md) Jun 2, 2021
@f1se4
Copy link

f1se4 commented Jun 2, 2021

I don't know if it helps, but for me has worked by commenting line 26 from /autoload/markdown.vim

let l:text = s:Center(l:text, '<< tr >>')

and changing to

let l:text = s:Center(l:text, '')

thks

@sotte
Copy link
Owner

sotte commented Jun 2, 2021

Thanks @f1se4. I assume you're using the non-figlet version?

@PhilRunninger introduced the markers (tr, h1, etc.) to, well, mark a given line and assign/link a normal syntax element to the newly marked one. Removing the <<tr>> does the trick (nothing to conceal when it does not exists), but it's only a workaround. I'll keep looking for a proper solution.

Thanks again!

@f1se4
Copy link

f1se4 commented Jun 2, 2021

yaps, well the python-figlet version hahahahhaa 😄

@PhilRunninger
Copy link
Contributor

@sotte

I can confirm it is working as advertised on Windows 10 with these versions of nvim and nvim-qt

NVIM v0.5.0-828-g0a95549d6
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

and

NVIM v0.5.0-dev+1372-g056c464e8
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

On my Macbook with nvim version

NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5

the tables are working correctly, but this issue may be showing up in the code block where the ```vim code fence is not being concealed. Never mind; this is caused by the older syntax/markdown.vim file that ships with the v0.4.4 version. This was fixed in this commit: tpope/vim-markdown@c043a93.

In summary, I'd say it's working as intended, and as it always has for me. There could be some obscure setting that I have in my config that makes it all work, so feel free to look around in it.

I'll be AFK for a while, but I'll check in when I can.

@sotte
Copy link
Owner

sotte commented Jun 4, 2021

@PhilRunninger thanks, that is super helpful!

I'm using https://github.com/plasticboy/vim-markdown, not tpope/markdown-vim (but I did in the past). I just tested with tpope's version and it looks much better:

Raw md:

# presenting.vim
### maintainer: Stefan Otte

#### a presentation tool for vim

<!--
  Comments are removed. They must be
  in the form of an HTML comment tag.
-->

\```python
def foo(a: str) -> None:
    return a.upper()
\```

| Last Name      | First Name | Born | Bacon Number |
|----------------|------------|------|--------------|
| Bacon          | Kevin      | 1958 | 0            |

- [ ] Not done yet
  - [ ] Task 1
- [x] Done
  - [x] Task 1

Rendered in vim with tpope/markdown-vim:
image

Rendered with presenting:
image

I get syntax hl in the raw md, but not in presenting.vim (I had to enable fenced code blocks let g:markdown_fenced_languages = ["python"]).

If this behavior is due to incompatibility between these two md plugins I'm not quite sure how to guarantee that presenting.vim works with both (without too much effort at least).

@sotte
Copy link
Owner

sotte commented Jun 4, 2021

Another try with no specific md plugin installed...and it woks :) fooo...
image

@sotte
Copy link
Owner

sotte commented Jun 4, 2021

@chris542 @rohitvvv @tkachuk-labs

  • What is your vim version?
  • What markdown plugin are you using (if any)?
  • What are your settings for the markdown plugin?

@PhilRunninger
Copy link
Contributor

tpope's markdown plugin is what ships with vim/neovim. And I have let g:markdown_fenced_languages = ["vim"].

@rohitvvv
Copy link

rohitvvv commented Jun 5, 2021

NVIM v0.5.0-dev+1087-g5ad32885d
Build type: Release
LuaJIT 2.1.0-beta3
I deleted my plugged directory and removed the vim-markdown from tpope.
I am using the following figlet fadein/vim-FIGlet

It has started to work as expected.

@ckangnz
Copy link

ckangnz commented Jun 11, 2021

@chris542 @rohitvvv @tkachuk-labs

  • What is your vim version?

  • What markdown plugin are you using (if any)?

  • What are your settings for the markdown plugin?

I'm using the latest vim8

These are the only configs i have for markdown

"sotte/presenting.vim
let g:presenting_figlets = 1

"gabrielelana/vim-markdown
let g:markdown_enable_mappings = 1
let g:markdown_enable_spell_checking = 0
let g:markdown_enable_conceal = 1
let g:markdown_enable_folding = 1
let g:vim_markdown_conceal_code_blocks = 0
let g:vim_markdown_fenced_languages = ['csharp=cs', 'js=javascript', 'sh=bash']

@igbanam
Copy link

igbanam commented Oct 12, 2023

Screen.Recording.2023-10-12.at.19.44.37.mov
:version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 28 2023 20:46:37)
macOS version - arm64
Included patches: 1-1950
Compiled by Homebrew

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants