Skip to content

Commit

Permalink
preserve capital after quote
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Mar 5, 2024
1 parent 9c89b23 commit de602a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Item utility functions require:

Please bundle the [Zotero schema](https://github.com/zotero/zotero-schema) file with your repository, do not load it remotely.

To run tests: `npm i && npm test`.
To run tests: `git submodule update --init --recursive && npm i && npm test`.
2 changes: 1 addition & 1 deletion test/data/sentenceCase.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"IS THE SOLAR SYSTEM STABLE?": "Is the solar system stable?",
"<i>Erratum:</i> “Analyzing the Growth of InₓGa₁₋ₓN/GaN Superlattices in Self-Induced GaN Nanowires by x-Ray Diffraction”": "<i>Erratum:</i> “analyzing the growth of InₓGa₁₋ₓN/GaN superlattices in self-induced GaN nanowires by x-ray diffraction”",
"<i>Erratum:</i> “Analyzing the Growth of InₓGa₁₋ₓN/GaN Superlattices in Self-Induced GaN Nanowires by x-Ray Diffraction”": "<i>Erratum:</i> “Analyzing the growth of InₓGa₁₋ₓN/GaN superlattices in self-induced GaN nanowires by x-ray diffraction”",
"<i>Erratum:</i> Analyzing the Growth of In<sub>x</sub>Ga<sub>1</sub>₋<sub>x</sub>N/GaN Superlattices in Self-Induced GaN Nanowires by X-Ray Diffraction": "<i>Erratum:</i> analyzing the growth of In<sub>x</sub>Ga<sub>1</sub>₋<sub>x</sub>N/GaN superlattices in self-induced GaN nanowires by X-ray diffraction",
"Chapter 3. Putting Ideas into Your Own Words and Paragraphs": "Chapter 3. Putting ideas into your own words and paragraphs",
"Structured Interviewing for OCB: Construct Validity, Faking, and the Effects of Question Type": "Structured interviewing for OCB: construct validity, faking, and the effects of question type",
Expand Down
6 changes: 3 additions & 3 deletions utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ var Utilities = {
});

// protect leading capital
text.replace(/^(<[^>]+>)?([\p{Lu}])/u, (match, markup, char) => {
markup = markup || "";
preserve.push({ start: markup.length, end: markup.length + char.length });
text.replace(/(^|["])(<[^>]+>)?([\p{Lu}])/gu, (match, prefix, markup, char, offset) => {
markup = markup || ''
preserve.push({ start: offset + prefix.length + markup.length, end: offset + prefix.length + markup.length + char.length });
});

// protect nocase
Expand Down

0 comments on commit de602a5

Please sign in to comment.