summaryrefslogtreecommitdiffstats
path: root/cnhttp.go
diff options
context:
space:
mode:
Diffstat (limited to 'cnhttp.go')
-rw-r--r--cnhttp.go18
1 files changed, 4 insertions, 14 deletions
diff --git a/cnhttp.go b/cnhttp.go
index f12074e..29d3cc6 100644
--- a/cnhttp.go
+++ b/cnhttp.go
@@ -406,16 +406,6 @@ func (srv *server) cnpCNMToHTML(w http.ResponseWriter, r *http.Request, req *cnp
}
hdrs := req.Header.String()
hdrs = hdrs[:len(hdrs)-1]
- host, _, _ := net.SplitHostPort(r.Host)
- if host == "" && r.Host != "" {
- host = r.Host
- }
- if host == "" {
- host = r.URL.Hostname()
- }
- if host == "" {
- host = req.Host()
- }
tmpl, err := templates.Clone()
if err != nil {
@@ -432,7 +422,7 @@ func (srv *server) cnpCNMToHTML(w http.ResponseWriter, r *http.Request, req *cnp
Req: breq.String(),
Resp: bresp.String(),
Doc: doc,
- Netcat: shellquote.Join("echo", hdrs) + " | " + shellquote.Join("nc", host, port),
+ Netcat: shellquote.Join("echo", hdrs) + " | " + shellquote.Join("nc", req.Host(), port),
Site: st,
Toc: tocSection{Children: toc},
Highlight: srv.highlighting,
@@ -561,7 +551,7 @@ func (srv *server) handleTags(req *cnp.Request, buf *bytes.Buffer, tags *[]strin
}
close := map[string]bool{
- "em": old.Emphasized && !new.Emphasized,
+ "b": old.Emphasized && !new.Emphasized,
"i": old.Alternate && !new.Alternate,
"code": old.Code && !new.Code,
"q": old.Quote && !new.Quote,
@@ -569,7 +559,7 @@ func (srv *server) handleTags(req *cnp.Request, buf *bytes.Buffer, tags *[]strin
}
open := map[string]bool{
- "em": !old.Emphasized && new.Emphasized,
+ "b": !old.Emphasized && new.Emphasized,
"i": !old.Alternate && new.Alternate,
"code": !old.Code && new.Code,
"q": !old.Quote && new.Quote,
@@ -592,7 +582,7 @@ func (srv *server) handleTags(req *cnp.Request, buf *bytes.Buffer, tags *[]strin
}
*tags = t[:pop]
- tagPush(buf, tags, open, "em", "<em>")
+ tagPush(buf, tags, open, "b", "<b>")
tagPush(buf, tags, open, "i", "<i>")
tagPush(buf, tags, open, "code", "<code>")
tagPush(buf, tags, open, "q", "<q>")