mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 01:57:20 +00:00
enable staticcheck QFxxxx rules (#34064)
This commit is contained in:
@ -80,9 +80,10 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
|
||||
// many places render non-comment contents with no mode=document, then these contents also use comment's hard line break setting
|
||||
// especially in many tests.
|
||||
markdownLineBreakStyle := ctx.RenderOptions.Metas["markdownLineBreakStyle"]
|
||||
if markdownLineBreakStyle == "comment" {
|
||||
switch markdownLineBreakStyle {
|
||||
case "comment":
|
||||
v.SetHardLineBreak(setting.Markdown.EnableHardLineBreakInComments)
|
||||
} else if markdownLineBreakStyle == "document" {
|
||||
case "document":
|
||||
v.SetHardLineBreak(setting.Markdown.EnableHardLineBreakInDocuments)
|
||||
}
|
||||
}
|
||||
@ -155,7 +156,7 @@ func (r *HTMLRenderer) renderDocument(w util.BufWriter, source []byte, node ast.
|
||||
if entering {
|
||||
_, err = w.WriteString("<div")
|
||||
if err == nil {
|
||||
_, err = w.WriteString(fmt.Sprintf(` lang=%q`, val))
|
||||
_, err = fmt.Fprintf(w, ` lang=%q`, val)
|
||||
}
|
||||
if err == nil {
|
||||
_, err = w.WriteRune('>')
|
||||
|
Reference in New Issue
Block a user