From 605b2f39dfa8c45fc3271c77f6fe37a9c2af9305 Mon Sep 17 00:00:00 2001 From: clsr Date: Wed, 20 Sep 2017 16:57:49 +0200 Subject: Support queries in URLs --- cnhttp.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cnhttp.go b/cnhttp.go index 29d3cc6..f9f9a30 100644 --- a/cnhttp.go +++ b/cnhttp.go @@ -551,7 +551,7 @@ func (srv *server) handleTags(req *cnp.Request, buf *bytes.Buffer, tags *[]strin } close := map[string]bool{ - "b": old.Emphasized && !new.Emphasized, + "b": old.Emphasized && !new.Emphasized, "i": old.Alternate && !new.Alternate, "code": old.Code && !new.Code, "q": old.Quote && !new.Quote, @@ -559,7 +559,7 @@ func (srv *server) handleTags(req *cnp.Request, buf *bytes.Buffer, tags *[]strin } open := map[string]bool{ - "b": !old.Emphasized && new.Emphasized, + "b": !old.Emphasized && new.Emphasized, "i": !old.Alternate && new.Alternate, "code": !old.Code && new.Code, "q": !old.Quote && new.Quote, @@ -626,6 +626,9 @@ func (srv *server) linkToURL(req *cnp.Request, link string) (urlStr, extern stri } urlStr = "/" + host + cnp.Clean("/"+urlStr) } + if u.RawQuery != "" { + urlStr += "?" + u.RawQuery + } if u.Fragment != "" { urlStr += "#" + u.Fragment } -- cgit