From 2fb075128ae6591a855ed067e68dfc7baca0422f Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Fri, 25 Dec 2020 17:53:31 -0500 Subject: [PATCH] Hyphenate "face-to-face" when appropriate --- lib/convert-worker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/convert-worker.js b/lib/convert-worker.js index 0e3bcda..1e6c0df 100644 --- a/lib/convert-worker.js +++ b/lib/convert-worker.js @@ -673,6 +673,11 @@ function fixHyphens(xml) { // noun cases are missing one or both hyphens. xml = xml.replace(/([Aa]) just[ -]in case/g, "$1 just-in-case"); + // When used as an adjective, it's hyphenated. It turns out most cases are as an adverb, so we go with this approach: + xml = xml.replace( + /face to face(?= meeting| hang-out| interaction| contact| conversation| confrontation| fight)/g, + "face-to-face"); + // This is usually correct but sometimes wrong. xml = xml.replace(/neo /g, "neo-");