From 3d2236710b6f2b6bbb778e5ed3a3f0a54320c5da Mon Sep 17 00:00:00 2001 From: David Gamba Date: Mon, 27 Feb 2023 22:09:36 -0700 Subject: [PATCH] Add basename function to sgml FuncMap This function is necessary to allow custom backends to only use the basename of an image in cases where images are stored as attachments. blockImageTmpl = `` --- pkg/renderer/sgml/sgml.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/renderer/sgml/sgml.go b/pkg/renderer/sgml/sgml.go index c06c3f59..04a604bf 100644 --- a/pkg/renderer/sgml/sgml.go +++ b/pkg/renderer/sgml/sgml.go @@ -3,6 +3,7 @@ package sgml import ( "fmt" "io" + "path/filepath" "strings" texttemplate "text/template" @@ -19,6 +20,7 @@ func Render(doc *types.Document, config *configuration.Configuration, output io. templates: tmpls, // Establish some default function handlers. functions: texttemplate.FuncMap{ + "basename": filepath.Base, "escape": escapeString, "halign": halign, "lastInStrings": lastInStrings,