Skip to content

Commit

Permalink
Merge branch 'fix-gcide-word-tags'
Browse files Browse the repository at this point in the history
* fix-gcide-word-tags:
  update submodule ref
  Add explicit tag fixes for source issues
  • Loading branch information
jeffbyrnes committed Aug 10, 2022
2 parents 6fc23b1 + ea2dc5c commit 91cdf6a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,27 @@ function replaceVarious (string: string) {
);
}

function fixWordTags (string: string) {
return (
string
//@TODO: remove these word-specific fixes as upstream changes are made
//fix missing closing p on Lese majesty
// GCIDE.L:12947
.replace(/(<p><sn>2.<\/sn> <def>Any affront to the dignity of an eminent or respected person.)/g, '</p>$1')

//fix extra opening p on Condorcet's method
// GCIDE.C:50718
.replace(/<p>(<hw>Condorcet's method<\/hw> <def>)/g, '$1')

//Fix extra tag in roller
// GCIDE.R:33326
.replace(/<p>(<sn>10.<\/sn> <fld>\(Zool.\)<\/fld> <def>Any species of small ground snakes of the family <fam>Tortricidae<\/fam>.<\/def><br\/)/g, '$1')

//fix missing closing p for stooge
// GCIDE.S:72154
.replace(/(<p><ent>Stook<\/ent><br\/)/g, '</p>$1')
);
}
/**
* Transcribe the greek (grk) tags
*/
Expand Down Expand Up @@ -235,6 +256,7 @@ function parseFiles (cb: () => void) {
}

function parseFile (file: string) {
file = fixWordTags(file);
file = replaceMatrices(file);
file = replaceEntities(file);
file = replaceVarious(file);
Expand Down

0 comments on commit 91cdf6a

Please sign in to comment.