mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
Package reorganization part 2
End goal is to simplify build
This commit is contained in:
@@ -3,7 +3,6 @@ package smtpd
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"fmt"
|
||||
"html"
|
||||
"io"
|
||||
"strings"
|
||||
)
|
||||
@@ -26,11 +25,3 @@ func HashMailboxName(mailbox string) string {
|
||||
io.WriteString(h, mailbox)
|
||||
return fmt.Sprintf("%x", h.Sum(nil))
|
||||
}
|
||||
|
||||
// TextToHtml takes plain text, escapes it and tries to pretty it up for
|
||||
// HTML display
|
||||
func TextToHtml(text string) string {
|
||||
text = html.EscapeString(text)
|
||||
replacer := strings.NewReplacer("\r\n", "<br/>\n", "\r", "<br/>\n", "\n", "<br/>\n")
|
||||
return replacer.Replace(text)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user