Skip to content

Commit d67113f

Browse files
feat: ability to not conceal wikilink destination when there is an alias
## Details New option can be set by: ```lua require('render-markdown').setup({ link = { wiki = { conceal_destination = false } }, }) ```
1 parent 0fd43fb commit d67113f

6 files changed

Lines changed: 16 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,8 @@ require('render-markdown').setup({
819819
enabled = true,
820820
-- Inlined with content.
821821
icon = '󱗖 ',
822+
-- Hide destination if there is an alias.
823+
conceal_destination = true,
822824
-- Custom processing for WikiLink body to show.
823825
body = function()
824826
return nil
@@ -1618,6 +1620,8 @@ require('render-markdown').setup({
16181620
enabled = true,
16191621
-- Inlined with content.
16201622
icon = '󱗖 ',
1623+
-- Hide destination if there is an alias.
1624+
conceal_destination = true,
16211625
-- Custom processing for WikiLink body to show.
16221626
body = function()
16231627
return nil

doc/render-markdown.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For NVIM v0.12.1 Last change: 2026 April 12
1+
*render-markdown.txt* For NVIM v0.12.1 Last change: 2026 April 20
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -885,6 +885,8 @@ Default Configuration ~
885885
enabled = true,
886886
-- Inlined with content.
887887
icon = '󱗖 ',
888+
-- Hide destination if there is an alias.
889+
conceal_destination = true,
888890
-- Custom processing for WikiLink body to show.
889891
body = function()
890892
return nil
@@ -1664,6 +1666,8 @@ Link Configuration ~
16641666
enabled = true,
16651667
-- Inlined with content.
16661668
icon = '󱗖 ',
1669+
-- Hide destination if there is an alias.
1670+
conceal_destination = true,
16671671
-- Custom processing for WikiLink body to show.
16681672
body = function()
16691673
return nil

lua/render-markdown/health.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ local state = require('render-markdown.state')
66
local M = {}
77

88
---@private
9-
M.version = '8.12.10'
9+
M.version = '8.12.11'
1010

1111
function M.check()
1212
M.start('versions')

lua/render-markdown/render/common/wiki.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function Render:run()
6565
})
6666
end
6767
-- hide destination if there is an alias
68-
if alias then
68+
if alias and config.conceal_destination then
6969
self:hide(start_col, #destination + 1)
7070
end
7171
else

lua/render-markdown/settings.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,7 @@ M.link = {}
12651265
---@class (exact) render.md.link.wiki.Config
12661266
---@field enabled boolean
12671267
---@field icon string
1268+
---@field conceal_destination boolean
12681269
---@field body fun(ctx: render.md.link.wiki.Context): render.md.mark.Text|string?
12691270
---@field highlight string
12701271
---@field scope_highlight? string
@@ -1324,6 +1325,8 @@ M.link.default = {
13241325
enabled = true,
13251326
-- Inlined with content.
13261327
icon = '󱗖 ',
1328+
-- Hide destination if there is an alias.
1329+
conceal_destination = true,
13271330
-- Custom processing for WikiLink body to show.
13281331
body = function()
13291332
return nil
@@ -1400,6 +1403,7 @@ function M.link.schema()
14001403
record = {
14011404
enabled = { type = 'boolean' },
14021405
icon = { type = 'string' },
1406+
conceal_destination = { type = 'boolean' },
14031407
body = { type = 'function' },
14041408
highlight = { type = 'string' },
14051409
scope_highlight = { optional = true, type = 'string' },

lua/render-markdown/types.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@
235235
---@class (exact) render.md.link.wiki.UserConfig
236236
---@field enabled? boolean
237237
---@field icon? string
238+
---@field conceal_destination? boolean
238239
---@field body? fun(ctx: render.md.link.wiki.Context): render.md.mark.Text|string?
239240
---@field highlight? string
240241
---@field scope_highlight? string

0 commit comments

Comments
 (0)