From 3d8559dcdc2822341e250bfd7dcbb0ba5b885ea0 Mon Sep 17 00:00:00 2001 From: Douglas Matoso Date: Tue, 16 Jul 2024 15:02:41 -0300 Subject: [PATCH] Add '/' to the list of splitter characters --- index.js | 2 +- test.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index db88861..ff383f5 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,7 @@ export function apStyleTitleCase(value, options) { const stop = configuration.stopwords || defaults const keep = configuration.keepSpaces - const splitter = /(\s+|[-‑–—,:;!?()])/ + const splitter = /(\s+|[-‑–—,:;!?()\/])/ return value .split(splitter) diff --git a/test.js b/test.js index 03d9eec..60ed37f 100644 --- a/test.js +++ b/test.js @@ -44,7 +44,8 @@ test('ap-style-title-case', function () { 'Observations of isolated pulsars and disk-fed X-ray binaries.', 'Observations of Isolated Pulsars and Disk-Fed X-Ray Binaries.' ], - ['Shakspeare; Or, the Poet', 'Shakspeare; or, the Poet'] + ['Shakspeare; Or, the Poet', 'Shakspeare; or, the Poet'], + ['before/after and/or end', 'Before/After and/or End'] ] for (const pattern of patterns) {