From 407907bece248f68676202029a6960dd73537e7f Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Tue, 2 Jul 2024 17:15:46 -0700 Subject: [PATCH] add / path prefix --- txt.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/txt.go b/txt.go index 5ae9e01..9821e69 100644 --- a/txt.go +++ b/txt.go @@ -128,7 +128,7 @@ type astTransformer struct{} func (t *astTransformer) Transform(node *ast.Document, reader text.Reader, pc parser.Context) { ast.Walk(node, func(n ast.Node, entering bool) (ast.WalkStatus, error) { if link, ok := n.(*ast.Link); ok && entering { - link.Destination = append([]byte("?t=txt&url="), link.Destination...) + link.Destination = append([]byte("/?t=txt&url="), link.Destination...) } if img, ok := n.(*ast.Image); ok && entering { // TODO: dynamic extension based on form value @@ -214,7 +214,6 @@ func smallGif(src []byte) ([]byte, error) { img = resize.Thumbnail(uint(*txtImgSize), uint(*txtImgSize), img, resize.NearestNeighbor) var gifBuf bytes.Buffer err = gif.Encode(&gifBuf, gifPalette(img, 216), &gif.Options{}) - //err =jpeg.Encode(&gifBuf, img, &jpeg.Options{Quality: 50}) if err != nil { return nil, fmt.Errorf("gif encode problem: %v", err) }