Skip to content

Commit 8e263a6

Browse files
authored
feat: allow setting a different hl group for inline code blocks (#87)
* feat: allow setting a different hl group for inline code blocks * fix: added missing types
1 parent 5e4e331 commit 8e263a6

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

Diff for: lua/render-markdown/colors.lua

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ M.colors = {
3232
H6Bg = 'DiffDelete',
3333
-- General
3434
Code = 'ColorColumn',
35+
CodeInline= 'RenderMarkdownCode',
3536
Bullet = 'Normal',
3637
Quote = '@markup.quote',
3738
Dash = 'LineNr',

Diff for: lua/render-markdown/handler/markdown_inline.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ M.render_code = function(info)
5252
opts = {
5353
end_row = info.end_row,
5454
end_col = info.end_col,
55-
hl_group = code.highlight,
55+
hl_group = code.highlight_inline,
5656
},
5757
}
5858
end

Diff for: lua/render-markdown/init.lua

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ local M = {}
7373
---@field public above? string
7474
---@field public below? string
7575
---@field public highlight? string
76+
---@field public highlight_inline? string
7677

7778
---@class render.md.UserHeading
7879
---@field public enabled? boolean
@@ -253,6 +254,7 @@ M.default_config = {
253254
below = '',
254255
-- Highlight for code blocks & inline code
255256
highlight = 'RenderMarkdownCode',
257+
highlight_inline = 'RenderMarkdownCodeInline',
256258
},
257259
dash = {
258260
-- Turn on / off thematic break rendering

Diff for: lua/render-markdown/types.lua

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
---@field public above string
5959
---@field public below string
6060
---@field public highlight string
61+
---@field public highlight_inline string
6162

6263
---@class render.md.Heading
6364
---@field public enabled boolean

0 commit comments

Comments
 (0)