Skip to content

Commit 1cd4920

Browse files
committed
removeLiteralQuotes: Escape '' as a single quote '
> To create a single quote itself, use two in a row: "# o''clock". https://www.unicode.org/reports/tr35/tr35-numbers.html Ref #890
1 parent d5e98d1 commit 1cd4920

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/remove-literal-quotes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ define(function() {
44
* removeLiteralQuotes( string )
55
*
66
* Return:
7-
* - `` if input string is `''`.
7+
* - `'` if input string is `''`.
88
* - `o'clock` if input string is `'o''clock'`.
99
* - `foo` if input string is `foo`, i.e., return the same value in case it isn't a single-quoted
1010
* string.
@@ -14,7 +14,7 @@ return function( string ) {
1414
return string;
1515
}
1616
if ( string === "''" ) {
17-
return "";
17+
return "'";
1818
}
1919
return string.replace( /''/g, "'" ).slice( 1, -1 );
2020
};

0 commit comments

Comments
 (0)