Skip to content

Commit 4bc2d33

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix markdown math brackets render problem (go-gitea#31420) Reduce `air` verbosity (go-gitea#31417) Fix new issue/pr avatar (go-gitea#31419) Increase max length of org team names from 30 to 255 characters (go-gitea#31410)
2 parents 5447ef0 + 90a3c20 commit 4bc2d33

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

.air.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ exclude_dir = [
2121
]
2222
exclude_regex = ["_test.go$", "_gen.go$"]
2323
stop_on_error = true
24+
25+
[log]
26+
main_only = true

modules/markup/markdown/markdown_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,10 @@ func TestMathBlock(t *testing.T) {
551551
"$$a$$",
552552
`<pre class="code-block is-loading"><code class="chroma language-math display">a</code></pre>` + nl,
553553
},
554+
{
555+
"$a$ ($b$) [$c$] {$d$}",
556+
`<p><code class="language-math is-loading">a</code> (<code class="language-math is-loading">b</code>) [$c$] {$d$}</p>` + nl,
557+
},
554558
}
555559

556560
for _, test := range testcases {

modules/markup/markdown/math/inline_parser.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ func isPunctuation(b byte) bool {
4545
return b == '.' || b == '!' || b == '?' || b == ',' || b == ';' || b == ':'
4646
}
4747

48+
func isBracket(b byte) bool {
49+
return b == ')'
50+
}
51+
4852
func isAlphanumeric(b byte) bool {
4953
return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || (b >= '0' && b <= '9')
5054
}
@@ -84,7 +88,7 @@ func (parser *inlineParser) Parse(parent ast.Node, block text.Reader, pc parser.
8488
break
8589
}
8690
suceedingCharacter := line[pos]
87-
if !isPunctuation(suceedingCharacter) && !(suceedingCharacter == ' ') {
91+
if !isPunctuation(suceedingCharacter) && !(suceedingCharacter == ' ') && !isBracket(suceedingCharacter) {
8892
return nil
8993
}
9094
if line[ender-1] != '\\' {

modules/structs/org_team.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Team struct {
2424
// CreateTeamOption options for creating a team
2525
type CreateTeamOption struct {
2626
// required: true
27-
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"`
27+
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(255)"`
2828
Description string `json:"description" binding:"MaxSize(255)"`
2929
IncludesAllRepositories bool `json:"includes_all_repositories"`
3030
// enum: read,write,admin
@@ -40,7 +40,7 @@ type CreateTeamOption struct {
4040
// EditTeamOption options for editing a team
4141
type EditTeamOption struct {
4242
// required: true
43-
Name string `json:"name" binding:"AlphaDashDot;MaxSize(30)"`
43+
Name string `json:"name" binding:"AlphaDashDot;MaxSize(255)"`
4444
Description *string `json:"description" binding:"MaxSize(255)"`
4545
IncludesAllRepositories *bool `json:"includes_all_repositories"`
4646
// enum: read,write,admin

web_src/css/repo.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,14 +530,10 @@ td .commit-summary {
530530
min-width: 100px;
531531
}
532532

533-
.repository.new.issue .comment.form .comment .avatar {
533+
#new-issue .avatar {
534534
width: 3em;
535535
}
536536

537-
.repository.new.issue .comment.form .content {
538-
margin-left: 4em;
539-
}
540-
541537
.repository.new.issue .comment.form .content::before,
542538
.repository.new.issue .comment.form .content::after {
543539
right: 100%;

0 commit comments

Comments
 (0)