mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-12 01:15:18 +02:00
fine tune
This commit is contained in:
@@ -68,10 +68,11 @@ func cssColorHandler(value string) bool {
|
||||
}
|
||||
|
||||
func (g *ASTTransformer) transformCodeSpan(_ *markup.RenderContext, v *ast.CodeSpan, reader text.Reader) {
|
||||
if v.FirstChild() != nil && v.FirstChild() == v.LastChild() {
|
||||
colorContent := v.FirstChild().Text(reader.Source())
|
||||
if cssColorHandler(string(colorContent)) {
|
||||
v.AppendChild(v, NewColorPreview(colorContent))
|
||||
}
|
||||
if v.FirstChild() == nil || v.FirstChild() != v.LastChild() {
|
||||
return
|
||||
}
|
||||
colorContent := v.FirstChild().Text(reader.Source())
|
||||
if cssColorHandler(string(colorContent)) {
|
||||
v.AppendChild(v, NewColorPreview(colorContent))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ func DeleteUser(ctx *context.APIContext) {
|
||||
// "$ref": "#/responses/validationError"
|
||||
|
||||
if ctx.ContextUser.IsOrganization() {
|
||||
ctx.APIError(http.StatusUnprocessableEntity, "target is an organization but not an user")
|
||||
ctx.APIError(http.StatusUnprocessableEntity, "target is an organization but not user")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ func RenameUser(ctx *context.APIContext) {
|
||||
// "$ref": "#/responses/validationError"
|
||||
|
||||
if ctx.ContextUser.IsOrganization() {
|
||||
ctx.APIError(http.StatusUnprocessableEntity, "target is an organization but not an user")
|
||||
ctx.APIError(http.StatusUnprocessableEntity, "target is an organization but not user")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user