summaryrefslogtreecommitdiffstats
path: root/markup/goldmark/goldmark_config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'markup/goldmark/goldmark_config/config.go')
-rw-r--r--markup/goldmark/goldmark_config/config.go31
1 files changed, 30 insertions, 1 deletions
diff --git a/markup/goldmark/goldmark_config/config.go b/markup/goldmark/goldmark_config/config.go
index 1c393e3f4..9a14bf9b8 100644
--- a/markup/goldmark/goldmark_config/config.go
+++ b/markup/goldmark/goldmark_config/config.go
@@ -73,10 +73,39 @@ var Default = Config{
// Config configures Goldmark.
type Config struct {
- DuplicateResourceFiles bool
Renderer Renderer
Parser Parser
Extensions Extensions
+ DuplicateResourceFiles bool
+ RenderHooks RenderHooks
+}
+
+// RenderHooks contains configuration for Goldmark render hooks.
+type RenderHooks struct {
+ Image ImageRenderHook
+ Link LinkRenderHook
+}
+
+// ImageRenderHook contains configuration for the image render hook.
+type ImageRenderHook struct {
+ // Enable the default image render hook.
+ // We need to know if it is set or not, hence the pointer.
+ EnableDefault *bool
+}
+
+func (h ImageRenderHook) IsEnableDefault() bool {
+ return h.EnableDefault != nil && *h.EnableDefault
+}
+
+// LinkRenderHook contains configuration for the link render hook.
+type LinkRenderHook struct {
+ // Disable the default image render hook.
+ // We need to know if it is set or not, hence the pointer.
+ EnableDefault *bool
+}
+
+func (h LinkRenderHook) IsEnableDefault() bool {
+ return h.EnableDefault != nil && *h.EnableDefault
}
type Extensions struct {