Fix issue markdown bugs (#17413)
* Bug fix: render Markdown `http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test` to HTML correctly, close #17394 * Bug fix: fix the positions of checkboxes in rendered HTML, close #17395 # Conflicts: # modules/markup/html.gorelease/v1.15
parent
3aecea2e6e
commit
175ebc6f88
|
@ -92,7 +92,7 @@ func isLinkStr(link string) bool {
|
||||||
func getIssueFullPattern() *regexp.Regexp {
|
func getIssueFullPattern() *regexp.Regexp {
|
||||||
if issueFullPattern == nil {
|
if issueFullPattern == nil {
|
||||||
issueFullPattern = regexp.MustCompile(regexp.QuoteMeta(setting.AppURL) +
|
issueFullPattern = regexp.MustCompile(regexp.QuoteMeta(setting.AppURL) +
|
||||||
`\w+/\w+/(?:issues|pulls)/((?:\w{1,10}-)?[1-9][0-9]*)([\?|#]\S+.(\S+)?)?\b`)
|
`\w+/\w+/(?:issues|pulls)/((?:\w{1,10}-)?[1-9][0-9]*)([\?|#](\S+)?)?\b`)
|
||||||
}
|
}
|
||||||
return issueFullPattern
|
return issueFullPattern
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,6 +265,10 @@ func TestRender_FullIssueURLs(t *testing.T) {
|
||||||
`<a href="http://localhost:3000/person/repo/issues/4#issuecomment-1234" class="ref-issue">person/repo#4</a>`)
|
`<a href="http://localhost:3000/person/repo/issues/4#issuecomment-1234" class="ref-issue">person/repo#4</a>`)
|
||||||
test("http://localhost:3000/gogits/gogs/issues/4",
|
test("http://localhost:3000/gogits/gogs/issues/4",
|
||||||
`<a href="http://localhost:3000/gogits/gogs/issues/4" class="ref-issue">#4</a>`)
|
`<a href="http://localhost:3000/gogits/gogs/issues/4" class="ref-issue">#4</a>`)
|
||||||
|
test("http://localhost:3000/gogits/gogs/issues/4 test",
|
||||||
|
`<a href="http://localhost:3000/gogits/gogs/issues/4" class="ref-issue">#4</a> test`)
|
||||||
|
test("http://localhost:3000/gogits/gogs/issues/4?a=1&b=2#comment-123 test",
|
||||||
|
`<a href="http://localhost:3000/gogits/gogs/issues/4?a=1&b=2#comment-123" class="ref-issue">#4</a> test`)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRegExp_sha1CurrentPattern(t *testing.T) {
|
func TestRegExp_sha1CurrentPattern(t *testing.T) {
|
||||||
|
|
|
@ -158,9 +158,12 @@
|
||||||
|
|
||||||
.task-list-item {
|
.task-list-item {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
input[type="checkbox"] {
|
input[type="checkbox"] {
|
||||||
margin: 0 6px .25em -1.6em;
|
position: absolute;
|
||||||
|
top: .25em;
|
||||||
|
left: -1.6em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue