These helpers provide some ability to manage strings for use within html content.
Summary | An escape function similar to what exists in javascript. This will compute a new string which certain characters have been replaced by a hexadecimal escape sequence |
Returns | The newly escaped string |
Remarks | / characters will be escaped with a | |
Parameters | |
str | String to escape |
Context
{
"value": "https://github.com/arinet/HandlebarDocs/blob/master/html.md#helpershtmlescape"
}
Usage
Returns
<strong>result:</strong>
https:\/\/github.com\/arinet\/HandlebarDocs\/blob\/master\/docs\/html.md#helpershtmlescape
Summary | Converts a string that has been HTML-encoded for HTTP transmission |
Returns | Decoded string |
Remarks | If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. HTML encoding converts characters that are not allowed in HTML into character-entity equivalents; HTML decoding reverses the encoding. For example, when embedded in a block of text, the characters < and > are encoded as < and > for HTTP transmission. |
Parameters | |
html | String to decode |
Context
{
"value": "Enter a string having '&' or '"' in it:"
}
Usage
Returns
<strong>result:</strong>
Enter a string having '&' or '"' in it:
Summary | Converts a string to an HTML-encoded string |
Returns | Encoded string |
Remarks | If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. HTML encoding converts characters that are not allowed in HTML into character-entity equivalents; HTML decoding reverses the encoding. For example, when embedded in a block of text, the characters < and > are encoded as < and > for HTTP transmission. |
Parameters | |
html | String to encode |
Context
{
"value": "Enter a string having '&' or '\"' in it:"
}
Usage
Returns
<strong>result:</strong>
Enter a string having '&' or '"' in it: