Skip to content

Commit dd6420a

Browse files
authored
Feature/remove html code (#2177)
* Add README for removing HTML tags in list view Document the purpose of removing HTML tags from fields. * Implement HTML tag removal and decoding in script.js Add a script to decode HTML entities and remove HTML tags from the 'fix_notes' field. * Update README with example image for HTML tag removal Added an example image to illustrate the removal of HTML tags. * Update README with screenshot for HTML tag removal Added a screenshot to illustrate the removal of HTML tags. * Decode HTML entities in fix_notes field
1 parent 349dc9e commit dd6420a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Removing the HTML tags from the HTML fields in the list view.
2+
For example, the 'Fix Notes' field in the problem table is an HTML field and displays with all the HTML tags in the list view.
3+
The screenshot below shows a difference in the list view.
4+
5+
<img width="1255" height="172" alt="image" src="https://github.com/user-attachments/assets/bff0f4ce-2d63-4ed9-9e70-3f3e27cc3f18" />
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//Create a new string field called 'Fix Notes(u_fix_notes)' in the problem table.
2+
//Select the 'calculated' checkbox in the field dictionary, and add the code to the script section.
3+
//This would be helpful if you want to export HTML fields in a report.
4+
(function calculatedFieldValue(current) {
5+
var htmlText = current.fix_notes; // Getting the value of the current fix notes (HTML field)
6+
var decodedText = htmlText.replace(/&#(\d+);/g, function(match, dec) {
7+
return String.fromCharCode(dec);
8+
}).replace(/<[^>]*>/g, '').replace(/&amp;/g, '&').replace(/&lt;/g, '<')
9+
.replace(/&gt;/g, '>').trim();
10+
return decodedText;
11+
})(current);
12+

0 commit comments

Comments
 (0)