From c9759ed32ac8b50321611de56a8ff70094c802fc Mon Sep 17 00:00:00 2001 From: clsr Date: Thu, 7 Sep 2017 17:25:36 +0200 Subject: Change emphasized back to , remove incorrect hostname handling --- cnhttp.go | 18 ++++-------------- static/style.css | 3 +-- 2 files changed, 5 insertions(+), 16 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", "") + tagPush(buf, tags, open, "b", "") tagPush(buf, tags, open, "i", "") tagPush(buf, tags, open, "code", "") tagPush(buf, tags, open, "q", "") diff --git a/static/style.css b/static/style.css index 08d6f63..9d6565a 100644 --- a/static/style.css +++ b/static/style.css @@ -179,8 +179,7 @@ img { max-width: 100%; } -em { - font-style: normal; +b { font-weight: bold; } -- cgit