Skip to content

Commit 7826f94

Browse files
wxiaoguangStelios Malathouras
authored and
Stelios Malathouras
committed
Fix issue markdown bugs (go-gitea#17411)
* Bug fix: render Markdown http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test to HTML correctly, close go-gitea#17394 * Bug fix: fix the positions of checkboxes in rendered HTML, close go-gitea#17395
1 parent f12b8bc commit 7826f94

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

modules/markup/html.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ var issueFullPatternOnce sync.Once
9494
func getIssueFullPattern() *regexp.Regexp {
9595
issueFullPatternOnce.Do(func() {
9696
issueFullPattern = regexp.MustCompile(regexp.QuoteMeta(setting.AppURL) +
97-
`\w+/\w+/(?:issues|pulls)/((?:\w{1,10}-)?[1-9][0-9]*)([\?|#]\S+.(\S+)?)?\b`)
97+
`\w+/\w+/(?:issues|pulls)/((?:\w{1,10}-)?[1-9][0-9]*)([\?|#](\S+)?)?\b`)
9898
})
9999
return issueFullPattern
100100
}

modules/markup/html_internal_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ func TestRender_FullIssueURLs(t *testing.T) {
265265
`<a href="http://localhost:3000/person/repo/issues/4#issuecomment-1234" class="ref-issue">person/repo#4</a>`)
266266
test("http://localhost:3000/gogits/gogs/issues/4",
267267
`<a href="http://localhost:3000/gogits/gogs/issues/4" class="ref-issue">#4</a>`)
268+
test("http://localhost:3000/gogits/gogs/issues/4 test",
269+
`<a href="http://localhost:3000/gogits/gogs/issues/4" class="ref-issue">#4</a> test`)
270+
test("http://localhost:3000/gogits/gogs/issues/4?a=1&b=2#comment-123 test",
271+
`<a href="http://localhost:3000/gogits/gogs/issues/4?a=1&amp;b=2#comment-123" class="ref-issue">#4</a> test`)
268272
}
269273

270274
func TestRegExp_sha1CurrentPattern(t *testing.T) {

web_src/less/markup/content.less

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,12 @@
158158

159159
.task-list-item {
160160
list-style-type: none;
161+
position: relative;
161162

162163
input[type="checkbox"] {
163-
margin: 0 6px .25em -1.6em;
164+
position: absolute;
165+
top: .25em;
166+
left: -1.6em;
164167
}
165168
}
166169

0 commit comments

Comments
 (0)