diff --git a/src/main/java/org/symphonyoss/symphony/messageml/elements/RegexElement.java b/src/main/java/org/symphonyoss/symphony/messageml/elements/RegexElement.java index c3646ddf..de6d5af1 100644 --- a/src/main/java/org/symphonyoss/symphony/messageml/elements/RegexElement.java +++ b/src/main/java/org/symphonyoss/symphony/messageml/elements/RegexElement.java @@ -92,6 +92,10 @@ default Map getRegexAttrForPresentationML(){ presentationAttrs.put(PRESENTATIONML_PATTERN_ERROR_MESSAGE_ATTR, getAttribute(PATTERN_ERROR_MESSAGE_ATTR)); } + if (getAttribute(PRESENTATIONML_PATTERN_ERROR_MESSAGE_ATTR) != null) { + presentationAttrs.put(PRESENTATIONML_PATTERN_ERROR_MESSAGE_ATTR, getAttribute(PRESENTATIONML_PATTERN_ERROR_MESSAGE_ATTR)); + } + return presentationAttrs; } @@ -101,7 +105,7 @@ default Map getRegexAttrForPresentationML(){ */ default Map getOtherAttributes(){ Map presentationAttrs = new LinkedHashMap<>(getAttributes()); - ALL_REGEX_ATTRS.stream().forEach(attr -> presentationAttrs.remove(attr)); + ALL_REGEX_ATTRS.forEach(presentationAttrs::remove); return presentationAttrs; } diff --git a/src/test/resources/examples/form.xml b/src/test/resources/examples/form.xml index e81fb62f..51f8c39c 100644 --- a/src/test/resources/examples/form.xml +++ b/src/test/resources/examples/form.xml @@ -58,7 +58,7 @@
Text Fields
- +