Customization attribute "calculated value"(Scripted base on) for HTML tags
It has set a process for automatic input in the calculated value to the attributes of the HTML type.
HTML Tag from being displayed as it is as a string.
I think there is no way to express in a state of being HTML encoded?
example
[WorkItem View before]
--------------------------------------------
in Script
GetValue = workitemattribute(attributeId);
//⇒"<strong>bold title</strong> "
return GetValue;
--------------------------------------------
[WorkItem View after]
Please,thanks
HTML Tag from being displayed as it is as a string.
I think there is no way to express in a state of being HTML encoded?
example
[WorkItem View before]
BOLD TITLE
--------------------------------------------
in Script
GetValue = workitemattribute(attributeId);
//⇒"<strong>bold title</strong> "
return GetValue;
--------------------------------------------
[WorkItem View after]
<strong>bold title</strong> I think there is no way to avoid?
Please,thanks
Accepted answer
I have not found a way to pass the text data from JavaScript into an HTML attribute without the tag information being escaped out.
From an API perspective, the data in such an attribute is an XML String. You can construct it from plain text, which escapes all tag data or you can create it as XML which leaves the tag data. I haven't found a way to do the latter in JavaScript. I can only do this in Java API.
From an API perspective, the data in such an attribute is an XML String. You can construct it from plain text, which escapes all tag data or you can create it as XML which leaves the tag data. I haven't found a way to do the latter in JavaScript. I can only do this in Java API.
Comments
Thanks Ralph
Why do you use XML?
Does this mean I do not use the "customization attribute"?
Instead, to create an Add-on in the JAVA-API?
I know the Java API and that uses
XMLString.createFromXMLText() to create content for html attributes with html tags in it. I haven't found a way to pass the information in Java Script that conforms to this method.
XMLString.createFromPlainText() to create content for html attributes which results in any html/xml tags being escaped out - like you see in the JavaScript if you just pass a string with tags.
One other answer
The results of the examination of this issue.
The last of the "return value" of the Script, we know is that it enables to some extent by changing.
Use the "decoration string" function of Javascript to value.
For example:
value.bold ();
value.italic ();
Disassemble the Attribute value for each HTMLTags.
"Value (i) <array>" and then consolidated with a Javascript function along to the tag.
For example:
return value (0) + value (1) .bold () + value (2) .italic ();
view
str0str1str2
Problem
1. It is an HTML document that has been freely written.
Because there is a need to pack to decompose and sequence for each tag from the beginning, you need to write a recursive processing.
2. failure to create a variable linked to before the return.
For example:
temp = value (0) + value (1) .bold () + value (2) .italic ();
return temp;
View
str0 <b> str1 </b> <i> str2 </i>
In particular, "2." We believe that or not is impossible to solve.
The last of the "return value" of the Script, we know is that it enables to some extent by changing.
Use the "decoration string" function of Javascript to value.
For example:
value.bold ();
value.italic ();
Disassemble the Attribute value for each HTMLTags.
"Value (i) <array>" and then consolidated with a Javascript function along to the tag.
For example:
return value (0) + value (1) .bold () + value (2) .italic ();
view
str0str1str2
Problem
1. It is an HTML document that has been freely written.
Because there is a need to pack to decompose and sequence for each tag from the beginning, you need to write a recursive processing.
2. failure to create a variable linked to before the return.
For example:
temp = value (0) + value (1) .bold () + value (2) .italic ();
return temp;
View
str0 <b> str1 </b> <i> str2 </i>
In particular, "2." We believe that or not is impossible to solve.