mirror of
https://github.com/tenox7/wrp.git
synced 2025-08-15 11:27:20 +00:00
pass img type and size
This commit is contained in:
2
txt.go
2
txt.go
@@ -171,7 +171,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("/?m=html&t="+t.imgType+"&s="+strconv.Itoa(t.maxSize)+"&url="), link.Destination...)
|
||||
}
|
||||
if img, ok := n.(*ast.Image); ok && entering {
|
||||
// TODO: dynamic extension based on form value
|
||||
|
Reference in New Issue
Block a user