MeanderingProgrammer / render-markdown.nvim

Plugin to improve viewing Markdown files in Neovim
MIT License
1.72k stars 38 forks source link

bug: emoji text is not rendered #155

Closed jiyeol-lee-kds closed 1 month ago

jiyeol-lee-kds commented 1 month ago

Neovim version (nvim -v)

0.10.1

Operating system

MacOS

Terminal emulator / GUI

Alacritty

Describe the bug

emoji text like :running_man: is not rendered like 🏃🏼‍♂️.

Expected behavior

When the cursor is in normal mode, I want to render emoji.

Healthcheck output

============================================================================== render-markdown: require("render-markdown.health").check()

render-markdown.nvim [version] ~

render-markdown.nvim [configuration] ~

render-markdown.nvim [nvim-treesitter] ~

render-markdown.nvim [executables] ~

render-markdown.nvim [conflicts] ~

Plugin configuration

  local render_markdown = require('render-markdown')
  local setup = {
    file_types = { 'markdown' },
    render_modes = { 'n', 'v', 'i', 'c' },
    indent = {
      enabled = false,
      per_level = 0,
    },
    heading = {
      position = 'inline',
      icons = { '[H1]', '[H2]', '[H3]', '[H4]', '[H5]', '[H6]' },
    },
    checkbox = {
      unchecked = { icon = '🌑', highlight = 'RenderMarkdownUnchecked' },
      checked = { icon = '🌕', highlight = 'RenderMarkdownChecked' },
      custom = {
        inprogress_1 = { raw = '[.]', rendered = '🌘', highlight = 'RenderMarkdownTodo' },
        inprogress_2 = { raw = '[o]', rendered = '🌗', highlight = 'RenderMarkdownTodo' },
        inprogress_3 = { raw = '[O]', rendered = '🌖', highlight = 'RenderMarkdownTodo' },
      }
    }
  }

  render_markdown.setup(setup)

  vim.treesitter.language.register('markdown', 'vimwiki')

Plugin error log

No Log

Confirmations

Additional information

No response

MeanderingProgrammer commented 1 month ago

Where in your config is the text running_man?

Or are you referring to resolving emojis in markdown documents in general?

That's not a feature stated anywhere as far as I know. Is this because the emojis resolve in Github?

jiyeol-lee-kds commented 1 month ago

Where in your config is the text running_man?

Or are you referring to resolving emojis in markdown documents in general?

That's not a feature stated anywhere as far as I know. Is this because the emojis resolve in Github?

I reported it because emojis resolved in markdown documents when I was only using vimwiki but since I added this plugin, it stops to resolve emojis. Do you think I missed some configuration?

MeanderingProgrammer commented 1 month ago

Huh I didn't know vimwiki had emoji support, but it looks like it does: https://github.com/search?q=repo%3Avimwiki%2Fvimwiki%20emoji&type=code.

I'm not really sure how to configure things so that this plugin does its part of the rendering and vimwiki continues to resolve emojis. There's definitely going to be edge cases when 2 plugins try to do rendering.

My first though is that the emojis rely on the conceal level to work. Can you try adding the following to the config:

local setup = {
  ...
  win_options = {
    conceallevel = { rendered = 2 },
  },
}
jiyeol-lee-kds commented 1 month ago

I just tried rendered = 0, rendered = 1, rendered = 2 and rendered = 3 but no luck :(

MeanderingProgrammer commented 1 month ago

Unfortunately I don't use vimwiki and do not know how it works well enough to debug this.

Plugins that attempt to do the same thing, i.e. rendering, are likely to clash in unexpected ways.

I'm not going to be able to put in the time to figure this one out so closing the issue. But if you do after some tinkering please update this issue so I can inform anyone else that experiences the same problem.