From dfd5a96558582d5f0456399118b8084e76043ef3 Mon Sep 17 00:00:00 2001 From: Alberto Mengali Date: Thu, 25 Sep 2025 11:46:14 +0200 Subject: [PATCH 1/2] add kwarg constructor as documented --- src/backends/text/types.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backends/text/types.jl b/src/backends/text/types.jl index 83fcbec6..627bfc21 100644 --- a/src/backends/text/types.jl +++ b/src/backends/text/types.jl @@ -305,5 +305,6 @@ struct TextHighlighter ) end end +TextHighlighter(f::Function; kwargs...) = TextHighlighter(f, Crayon(; kwargs...)) _text__default_highlighter_fd(h::TextHighlighter, ::Any, ::Int, ::Int) = h._decoration From 9286ca78670bc1664b9394f8683b7f236b63fa2e Mon Sep 17 00:00:00 2001 From: Alberto Mengali Date: Thu, 25 Sep 2025 12:18:37 +0200 Subject: [PATCH 2/2] update test for covering new constructor --- test/backends/text/highlighters.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/backends/text/highlighters.jl b/test/backends/text/highlighters.jl index 354f8e49..7df3507e 100644 --- a/test/backends/text/highlighters.jl +++ b/test/backends/text/highlighters.jl @@ -25,7 +25,7 @@ color = true, highlighters = [ TextHighlighter((data, i, j) -> data[i, j] % 2 == 0, crayon"bold fg:cyan") - TextHighlighter((data, i, j) -> data[i, j] % 2 == 0, crayon"bold") + TextHighlighter((data, i, j) -> data[i, j] % 2 == 0; bold = true) TextHighlighter((data, i, j) -> data[i, j] % 2 != 0, crayon"bold italics") ] )