aboutsummaryrefslogblamecommitdiff
path: root/http_template_funcs.go
blob: 016d268af359f7d373b54e4913f0033a402dba05 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                                                       

            
        
                 
              

                 




                                            
 
                                 
                           
 







                                    
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-FileContributor: Runxi Yu <https://runxiyu.org>

package main

import (
	"net/url"
	"path"
	"strings"
)

func first_line(s string) string {
	before, _, _ := strings.Cut(s, "\n")
	return before
}

func base_name(s string) string {
	return path.Base(s)
}

func path_escape(s string) string {
	return url.PathEscape(s)
}

func query_escape(s string) string {
	return url.QueryEscape(s)
}