Description
Steps to Reproduce
-
On UI16+, navigate to Incident > Open and select an incident.
-
Add invalid HTML text using [code] ... [/code] tags to a Work notes field.
For example, copy the following text and click Update.
[code]
<p align="center"style="">Tag attributes have no space between them</p>
[/code]Note – Do not include a space between "center" and "style."
Note that a blank comment or Work note is added and the JavaScript console displays the following message:
Error: [$sanitize:badparse] http://errors.angularjs.org/1.4.8/$sanitize/badparse?p0=%3Cp%20align%3D%22center%22style%3D%22%22%3ETag%20attributes%20have%20no%20space%3C/p%3E
Workaround
Ensure that the HTML tags that are added using [code]... [/code] are valid on journal fields
Several workarounds are available:
-
Instead of using the [code] tag, use the text version or strip the text from the HTML instead.
-
Switch to UI15.
-
Make the code tag visible by setting the glide.ui.security.allow_codetag system property to false.
-
Create scripts to fix the malformed HTML, for example, using regular expressions. The following example applies to the test case:
--background script -----
gs.print(addspacesmissingonhtmltags(
'<a href="https://www.google.com"target="hello"stuff="things" omg="wow">stuff " and things" </a>'
));
function addspacesmissingonhtmltags(a) {
return a.replace(/(\B"\w+[^"]*")/g, "$& ")
};
--background script -----Result:
[0:00:00.004] Script completed in scope global: script
*** Script: <a href="https://www.google.com" target="hello" stuff="things" omg="wow" >stuff " and things" </a>
Related Problem: PRB660886