|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
621 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Converts the characters "&", "<", ">", '"', and "'" in `str` to their corresponding HTML entities.
|
|---|
| 3 | * For example, "<" becomes "<".
|
|---|
| 4 | *
|
|---|
| 5 | * @param {string} str The string to escape.
|
|---|
| 6 | * @returns {string} Returns the escaped string.
|
|---|
| 7 | *
|
|---|
| 8 | * @example
|
|---|
| 9 | * escape('This is a <div> element.'); // returns 'This is a <div> element.'
|
|---|
| 10 | * escape('This is a "quote"'); // returns 'This is a "quote"'
|
|---|
| 11 | * escape("This is a 'quote'"); // returns 'This is a 'quote''
|
|---|
| 12 | * escape('This is a & symbol'); // returns 'This is a & symbol'
|
|---|
| 13 | */
|
|---|
| 14 | declare function escape(str: string): string;
|
|---|
| 15 |
|
|---|
| 16 | export { escape };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.