Skip to content

Commit

Permalink
add / path prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
tenox7 committed Jul 3, 2024
1 parent f838caa commit 407907b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions txt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 407907b

Please sign in to comment.