mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Unescape with broken regexp (#2992)
This commit is contained in:
committed by
John-David Dalton
parent
477fdb2cf2
commit
39931f9eaa
@@ -10,12 +10,12 @@ const htmlUnescapes = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Used to match HTML entities and HTML characters. */
|
/** Used to match HTML entities and HTML characters. */
|
||||||
const reEscapedHtml = /&(?:amp|lt|gt|quot|#39)g
|
const reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g
|
||||||
const reHasEscapedHtml = RegExp(reEscapedHtml.source)
|
const reHasEscapedHtml = RegExp(reEscapedHtml.source)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The inverse of `escape`this method converts the HTML entities
|
* The inverse of `escape`this method converts the HTML entities
|
||||||
* `&, `<` `>`,`"`, nd `'` in`string` to
|
* `&`, `<`, `>`, `"` and `'` in `string` to
|
||||||
* their corresponding characters.
|
* their corresponding characters.
|
||||||
*
|
*
|
||||||
* **Note:** No other HTML entities are unescaped. To unescape additional
|
* **Note:** No other HTML entities are unescaped. To unescape additional
|
||||||
@@ -28,7 +28,7 @@ const reHasEscapedHtml = RegExp(reEscapedHtml.source)
|
|||||||
* @see escape, escapeRegExp
|
* @see escape, escapeRegExp
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* unescape('fred, barney, &pebbles')
|
* unescape('fred, barney, & pebbles')
|
||||||
* // => 'fred, barney, & pebbles'
|
* // => 'fred, barney, & pebbles'
|
||||||
*/
|
*/
|
||||||
function unescape(string) {
|
function unescape(string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user