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

Additional markdown syntax not rendering #286

Closed
catasaurus opened this issue Dec 31, 2023 · 15 comments
Closed

Additional markdown syntax not rendering #286

catasaurus opened this issue Dec 31, 2023 · 15 comments
Labels
bug Something isn't working

Comments

@catasaurus
Copy link

🐛 Describe the bug

When I create checkboxes, they simply do not render. I don't know the expected behavior for the rendering of other markdown, but I have seen screenshots of checkboxes rendered. I know I wrote them right as when I open the file in Obsidian (the desktop client), they render perfectly fine.

aliases:
  - test_markdown_rendering
tags: []
---

# test_markdown_rendering

- [ ] testing this still

## markdown not rendering for some reason
- [ ] item 2

### Versions

~ via 🐍 v3.9.12 
❯ nvim --version
NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1700008891

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.9.4/share/nvim"

Run :checkhealth for more info

~ via 🐍 v3.9.12 
❯               
nvim --headless -c 'lua require("obsidian").info()' -c q
[obsidian.nvim (v2.5.0)] Commit SHA: 88bf9150d9639a2cae3319e76abd7ab6b30d27f0
[plenary.nvim] Commit SHA: 55d9fe89e33efd26f532ef20223e5f9430c8b0c0
[nvim-cmp] Commit SHA: 538e37ba87284942c1d76ed38dd497e54e65b891
[telescope.nvim] Commit SHA: d90956833d7c27e73c621a61f20b29fdb7122709
ripgrep 14.0.3%                                                                                                                                     

~ via 🐍 v3.9.12 
❯ 
@catasaurus catasaurus added the bug Something isn't working label Dec 31, 2023
@sebassdc
Copy link

Same issue here

❯ nvim --headless -c 'lua require("obsidian").info()' -c q
[obsidian.nvim (v2.5.0)] Commit SHA: 88bf9150d9639a2cae3319e76abd7ab6b30d27f0
[plenary.nvim] Commit SHA: 55d9fe89e33efd26f532ef20223e5f9430c8b0c0
[nvim-cmp] Commit SHA: 538e37ba87284942c1d76ed38dd497e54e65b891
[telescope.nvim] Commit SHA: 54930e1abfc94409e1bb9266e752ef8379008592
[vim-markdown] Commit SHA: 46add6c3017d3e4035dc10ffa9cb54221d8dfe1a
ripgrep 13.0.0%

@epwalsh
Copy link
Owner

epwalsh commented Jan 1, 2024

Hey @catasaurus, please check if your conceallevel is set properly. See https://github.com/epwalsh/obsidian.nvim#concealing-characters.

@alphaone
Copy link

alphaone commented Jan 4, 2024

I have a similar issue. I have to set the conceallevel exactly to "1", to see the rendered checkboxes:
Screenshot 2024-01-04 at 16 11 36

For conceallevel=0 I get this (expected):
Screenshot 2024-01-04 at 16 12 33

For conceallevel=3 (which is my default) I get nothing (unexpected):
Screenshot 2024-01-04 at 16 13 31

@sebassdc
Copy link

sebassdc commented Jan 4, 2024

@epwalsh @alphaone Thank you! that did the trick on my end

@epwalsh
Copy link
Owner

epwalsh commented Jan 4, 2024

Just to reiterate, obsidian.nvim sets explicit conceal characters, so either conceallevel=1 or conceallevel=2 will work. conceallevel=3 forces even the overlayed characters to be hidden. A quick way to ensure this is set correctly for markdown files is to add a file called after/ftplugin/markdown.lua in your neovim config directory (usually ~/.config/nvim) with the following:

vim.opt_local.conceallevel = 2

I've just pushed a commit that will warn users when they have obsidian.nvim's UI features enabled yet their conceallevel isn't set correctly.

@epwalsh epwalsh closed this as completed in 72d1ea1 Jan 4, 2024
@epwalsh epwalsh pinned this issue Jan 4, 2024
@epwalsh epwalsh changed the title Markdown not rendering Additional markdown syntax not rendering Jan 4, 2024
@FilipHarald
Copy link
Contributor

@epwalsh I think the conceal-level warning could be useful. But how do I turn the warning off if I want to see all characters, and actually have vim.opt_local.conceallevel = 0?

@epwalsh
Copy link
Owner

epwalsh commented Jan 11, 2024

@FilipHarald you can simply disable this plugin's UI features by setting ui.enable = false in your obsidian.nvim config.

@catasaurus
Copy link
Author

Thanks for all the help! Sorry I took a while to check back on this.

@anuramat
Copy link

is it possible to suppress the warning without turning off the the feature? I have a vim: cole=0 modeline in some of the files

@epwalsh
Copy link
Owner

epwalsh commented Apr 10, 2024

Hey @anuramat you could set log_level = vim.log.levels.ERROR, but that would disable pretty much all messages, so might not be desirable. I'm happy to accept a PR to disable to disable this. In particular we could add another config field like disable_user_warnings: boolean.

stianfro added a commit to stianfro/astronvim_config that referenced this issue Apr 17, 2024
@dromse
Copy link

dromse commented May 1, 2024

@epwalsh It would be awesome to have this warning disable option. Because I use only conceallevel=0, and I need only colorized checkboxes. But when I open my notes this warning is disrupting me all time from doing another things.

@robertjdominguez
Copy link

@epwalsh, I know this is closed, but a related question: should this configuration work in LazyVim as well? As you can see in this recording, with conceallevel set to 1, checkboxes continue to not render while other formatting does.

Thanks for any guidance!

Screen.Recording.2024-05-01.at.6.08.20.PM.mov

@epwalsh
Copy link
Owner

epwalsh commented May 1, 2024

@robertjdominguez that looks like a font issue. If you don't have a patched font you'll need to use different characters than what's in the README.

@robertjdominguez
Copy link

Bang on! Great call — thanks, @epwalsh 🙏

@swahpy
Copy link

swahpy commented May 15, 2024

Hi JFYI,
I also setup markdown_oxide in my neovim config and after that the conceallevel I've set in obsidian.lua was overwritten. Like below(the lsp configurations), I have to config conceallevel again in lsp config.

["markdown_oxide"] = function ()
  lspconfig.markdown_oxide.setup({
    capabilities = capabilities, -- again, ensure that capabilities.workspace.didChangeWatchedFiles.dynamicRegistration = true
    ---@diagnostic disable-next-line:unused-local
    on_attach = function (client, bufnr)
      -- refresh codelens on TextChanged and InsertLeave as well
      vim.api.nvim_create_autocmd({ 'TextChanged', 'InsertLeave', 'CursorHold', 'LspAttach' }, {
        buffer = bufnr,
        callback = vim.lsp.codelens.refresh,
      })

      -- trigger codelens refresh
      vim.api.nvim_exec_autocmds('User', { pattern = 'LspAttached' })

      -- setup conceallevel to enable it in obsidian.nvim
      vim.opt.conceallevel = 2
    end
  })
end

And to disable the warning message I have to set it again in obsidian.nvim setup function.

laitoch pushed a commit to laitoch/nvim that referenced this issue Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants