fine tune

This commit is contained in:
wxiaoguang
2026-06-07 13:19:59 +08:00
parent 2e4d253dd6
commit bc9927f4e8
2 changed files with 8 additions and 7 deletions

View File

@@ -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))
}
}

View File

@@ -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
}