n3 2.7.8 → 2.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/n3.esm.min.js +1 -1
- package/browser/n3.min.js +1 -1
- package/lib/N3Lexer.js +5 -3
- package/package.json +1 -1
- package/src/N3Lexer.js +6 -3
package/lib/N3Lexer.js
CHANGED
|
@@ -498,9 +498,11 @@ class N3Lexer {
|
|
|
498
498
|
_parseLiteral(input) {
|
|
499
499
|
// Ensure we have enough lookahead to identify triple-quoted strings
|
|
500
500
|
if (input.length >= 3) {
|
|
501
|
-
//
|
|
502
|
-
const
|
|
503
|
-
const openingLength =
|
|
501
|
+
// The caller has already identified a single or double quote.
|
|
502
|
+
const quote = input[0];
|
|
503
|
+
const openingLength = input[1] === quote && input[2] === quote ? 3 : 1;
|
|
504
|
+
let opening = quote;
|
|
505
|
+
if (openingLength === 3) opening = quote === '"' ? '"""' : "'''";
|
|
504
506
|
|
|
505
507
|
// Find the next candidate closing quotes
|
|
506
508
|
let closingPos = Math.max(this._literalClosingPos, openingLength);
|
package/package.json
CHANGED
package/src/N3Lexer.js
CHANGED
|
@@ -524,9 +524,12 @@ export default class N3Lexer {
|
|
|
524
524
|
_parseLiteral(input) {
|
|
525
525
|
// Ensure we have enough lookahead to identify triple-quoted strings
|
|
526
526
|
if (input.length >= 3) {
|
|
527
|
-
//
|
|
528
|
-
const
|
|
529
|
-
const openingLength =
|
|
527
|
+
// The caller has already identified a single or double quote.
|
|
528
|
+
const quote = input[0];
|
|
529
|
+
const openingLength = input[1] === quote && input[2] === quote ? 3 : 1;
|
|
530
|
+
let opening = quote;
|
|
531
|
+
if (openingLength === 3)
|
|
532
|
+
opening = quote === '"' ? '"""' : "'''";
|
|
530
533
|
|
|
531
534
|
// Find the next candidate closing quotes
|
|
532
535
|
let closingPos = Math.max(this._literalClosingPos, openingLength);
|