MeanderingProgrammer / render-markdown.nvim

Plugin to improve viewing Markdown files in Neovim
MIT License
1.38k stars 33 forks source link

feature: Support custom titles for callouts #109

Closed AquilesGomez closed 1 month ago

AquilesGomez commented 1 month ago

Neovim version (nvim -v)

0.10.1

Operating system

MacOS

Terminal emulator / GUI

Iterm2

Describe the bug

When I add a title to a callout block header, the rendering doesn't keep the space between the text properly.

Screenshot 2024-07-31 at 8 25 04 AM

Expected behavior

I expect the Title to have spaces between the callout block and the title

Healthcheck output

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

markdown.nvim [neovim version] ~

markdown.nvim [configuration] ~

markdown.nvim [nvim-treesitter] ~

markdown.nvim [executables] ~

Plugin configuration

require("render-markdown").setup { callout = { done = { raw = "[!Done]", rendered = "󰄬 Done", highlight = "RenderMarkdownSuccess" }, info = { raw = "[!info]", rendered = "󰋽 Info", highlight = "RenderMarkdownInfo" }, time = { raw = "[!timestamp]", rendered = " Timestamp", highlight = "RenderMarkdownInfo" }, }, }

Confirmations

Additional information

No response

MeanderingProgrammer commented 1 month ago

While this plugin supports callouts it does not support callouts with custom titles, this is a feature request not a bug.

Github's parser fails to preview them as well, if you try out:

> [!NOTE] TEST
> TEST

Here's the result:

[!NOTE] TEST TEST

Normal callouts work though:

> [!NOTE]
> TEST

[!NOTE] TEST

Requested feature comes from obsidian: https://help.obsidian.md/Editing+and+formatting/Callouts#Change+the+title

MeanderingProgrammer commented 1 month ago

Ive added support for custom callout titles as documented by obsidian in this commit: https://github.com/MeanderingProgrammer/markdown.nvim/commit/a1bcbf4858d1834f922029b5fc6ae55a7417bd51

Please update and LMK if it works!