jdaugherty commented on code in PR #15475:
URL: https://github.com/apache/grails-core/pull/15475#discussion_r2868295594


##########
grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/taglib/FormatTagLib.groovy:
##########
@@ -327,13 +327,25 @@ class FormatTagLib implements TagLibrary {
             number = decimalFormat.parse(number as String)
         }
 
+        // Normalize Unicode minus sign (U+2212) to ASCII hyphen-minus (U+002D)
+        // for HTML compatibility (fixes grails-core#15178)
+        DecimalFormatSymbols formatSymbols = decimalFormat.decimalFormatSymbols
+        formatSymbols.minusSign = '-' as char

Review Comment:
   Isn't this assuming we are formatting for an input?  From what I can tell, 
this tag isn't for an input, so this is not the right change



##########
grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/taglib/ValidationTagLib.groovy:
##########
@@ -471,7 +471,12 @@ class ValidationTagLib implements TagLibrary {
         PropertyEditor editor = registry.findCustomEditor(value.getClass(), 
propertyPath)
         if (editor) {
             editor.setValue(value)
-            return !(value instanceof Number) ? editor.asText?.encodeAsHTML() 
: editor.asText
+            String formattedValue = editor.asText
+            if (value instanceof Number && formattedValue != null) {
+                DecimalFormatSymbols formatSymbols = new 
DecimalFormatSymbols(webRequest.getLocale())
+                formattedValue = 
formattedValue.replace(formatSymbols.minusSign, '-' as char)
+            }
+            return !(value instanceof Number) ? formattedValue?.encodeAsHTML() 
: formattedValue

Review Comment:
   Again, this doesn't appear to be inout specific



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to