Enclose text content in readonly textarea to preserve formatting

This commit is contained in:
Seednode 2023-09-12 19:12:40 -05:00
parent cc00a1b63b
commit 57bcd40c29
2 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ import (
) )
const ( const (
ReleaseVersion string = "0.72.1" ReleaseVersion string = "0.72.2"
) )
var ( var (

View File

@ -18,8 +18,8 @@ func RegisterText() *Type {
var css strings.Builder var css strings.Builder
css.WriteString(`html,body{margin:0;padding:0;height:100%;}`) css.WriteString(`html,body{margin:0;padding:0;height:100%;}`)
css.WriteString(`a{color:inherit;display:block;height:100%;width:100%;text-decoration:none;}`) css.WriteString(`a{color:inherit;display:block;height:100%;width:100%;text-decoration:none;overflow:hidden;}`)
css.WriteString(`pre{margin:.5rem;}`) css.WriteString(`textarea{border:none;caret-color:transparent;outline:none;margin:0 .5rem 0 .5rem;height:100%;width:99%;overflow:auto;}`)
return css.String() return css.String()
}, },
@ -32,7 +32,7 @@ func RegisterText() *Type {
body = []byte{} body = []byte{}
} }
return fmt.Sprintf(`<a href="/%s"><pre>%s</pre></a>`, return fmt.Sprintf(`<a href="/%s"><textarea autofocus readonly>%s</textarea></a>`,
queryParams, queryParams,
body) body)
}, },