typographic-quotes
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -13,3 +13,3 @@ 'use strict'; | ||
var localeQuotes = quotesDB[locale]; | ||
var pattern = /(^|\s)(?:"(.*?)"|'(.*?)')(\s|$)/gim; | ||
var pattern = /(^|\s)(?:"(.*?)"|'(.*?)')(\s|$|\.|,)/gim; | ||
@@ -16,0 +16,0 @@ var primary = function primary(match) { |
@@ -5,3 +5,3 @@ import quotesDB from 'typographic-quotes-l10n-db'; | ||
const localeQuotes = quotesDB[locale]; | ||
const pattern = /(^|\s)(?:"(.*?)"|'(.*?)')(\s|$)/gim; | ||
const pattern = /(^|\s)(?:"(.*?)"|'(.*?)')(\s|$|\.|,)/gim; | ||
@@ -8,0 +8,0 @@ const primary = (match, before='', part1='', part2='', after='')=> { |
{ | ||
"name": "typographic-quotes", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Always use curly quotes", | ||
@@ -5,0 +5,0 @@ "main": "index.es5.js", |
14
test.js
@@ -19,2 +19,9 @@ import quotes from './index'; | ||
it('should fix simple quotes ending quite before punctuation', ()=> { | ||
equal(quotes(`foo 'foo'. bar`), `foo “foo”. bar`); | ||
equal(quotes(`foo "foo". bar`), `foo “foo”. bar`); | ||
equal(quotes(`foo 'foo', bar`), `foo “foo”, bar`); | ||
equal(quotes(`foo "foo", bar`), `foo “foo”, bar`); | ||
}); | ||
it('should fix simple quotes and not messing up with apostrophes', ()=> { | ||
@@ -45,2 +52,9 @@ equal(quotes(`foo's 'foo' bar`), `foo's “foo” bar`); | ||
it('should fix nested quotes ending quite before punctuation', ()=> { | ||
equal(quotes(`foo "foo 'inside' bar". Start`), `foo “foo ‘inside’ bar”. Start`); | ||
equal(quotes(`foo 'foo "inside" bar'. Start`), `foo “foo ‘inside’ bar”. Start`); | ||
equal(quotes(`foo "foo 'inside' bar", continuing`), `foo “foo ‘inside’ bar”, continuing`); | ||
equal(quotes(`foo 'foo "inside" bar', continuing`), `foo “foo ‘inside’ bar”, continuing`); | ||
}); | ||
it('should fix several nested quotes', ()=> { | ||
@@ -47,0 +61,0 @@ equal(quotes(`foo "foo 'inside' bar" bar foo "foo 'inside' bar" bar`), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9296
104