mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 01:57:20 +00:00
Fix markdown render behaviors (#34122)
* Fix #27645 * Add config options `MATH_CODE_BLOCK_DETECTION`, problematic syntaxes are disabled by default * Fix #33639 * Add config options `RENDER_OPTIONS_*`, old behaviors are kept
This commit is contained in:
@ -219,6 +219,13 @@ func IfZero[T comparable](v, def T) T {
|
||||
return v
|
||||
}
|
||||
|
||||
func IfEmpty[T any](v, def []T) []T {
|
||||
if len(v) == 0 {
|
||||
return def
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// OptionalArg helps the "optional argument" in Golang:
|
||||
//
|
||||
// func foo(optArg ...int) { return OptionalArg(optArg) }
|
||||
|
Reference in New Issue
Block a user