From 78e7b14f883d8b8d9956aa38291184cac34c7765 Mon Sep 17 00:00:00 2001 From: Brano Sandala Date: Sun, 22 Sep 2024 01:03:58 +0200 Subject: [PATCH 1/5] Service mark --- CHANGELOG.md | 4 + README.md | 1 + dist/typopo.min.js | 2 +- dist/typopo_dist.min.js | 2 +- src/lib/examples.js | 2 +- src/lib/symbols/marks.js | 43 +++++++++ src/lib/symbols/registered-trademark.js | 15 ---- src/lib/symbols/trademark.js | 15 ---- src/locale/locale.js | 3 +- src/test/integration/typopo.test.js | 5 ++ src/test/symbols/marks.test.js | 90 +++++++++++++++++++ src/test/symbols/registered-trademark.test.js | 33 ------- src/test/symbols/trademark.test.js | 31 ------- src/typopo.js | 6 +- 14 files changed, 150 insertions(+), 102 deletions(-) create mode 100644 src/lib/symbols/marks.js delete mode 100644 src/lib/symbols/registered-trademark.js delete mode 100644 src/lib/symbols/trademark.js create mode 100644 src/test/symbols/marks.test.js delete mode 100644 src/test/symbols/registered-trademark.test.js delete mode 100644 src/test/symbols/trademark.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index c3451df..d595834 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,13 @@ ## 2.5.8 // +### 💪 Improvements +- Fix Service Mark, when indicated in brackets, i.e. `Brand(sm)` → `Brand℠` + ### 🔨 Maintenance - Add a build automation - Automate copyright notice updates in source and dist files +- Refactor code for Registered Trademark (®) and Trademark (™) diff --git a/README.md b/README.md index 57dd576..a4f14fb 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ Typopo fixes symbols: - copyright ((c)2020 → © 2020) - sound recording copyright ((p)2020 → ℗ 2020) - registered trademark (Brand(r) → Brand®) +- service mark (Brand(sm) → Brand℠) - trademark (Brand(tm) → Brand™) - plus-minus sign (+-, -+ → ±) - square and cube exponents (e.g. 100 µm² → 100 µm², 50 km³ → 50 km³) diff --git a/dist/typopo.min.js b/dist/typopo.min.js index 013ad84..29a9b45 100644 --- a/dist/typopo.min.js +++ b/dist/typopo.min.js @@ -3,4 +3,4 @@ * Copyright 2015–2024 Braňo Šandala (https://brano.me) * Licensed under MIT (https://github.com/surfinzap/typopo/blob/main/LICENSE.txt) */ -!function r(s,a,i){function o(n,e){if(!a[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=a[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,a,i)}return a[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="(\\(c\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.copyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.copyright),e=(0,s.addNbspAfterSymbol)(e,n,n.copyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.copyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":19,"../whitespace/spaces":20}],10:[function(e,n,t){function r(e,n,t,r){n="(["+n.spaces+n.slash+"])(m|dam|hm|km|Mm|Gm|Tm|Pm|Em|Zm|Ym|m|dm|cm|mm|µm|nm|pm|fm|am|zm|ym)("+t+")",t=new RegExp(n,"g");return e.replace(t,"$1$2"+r)}function s(e,n){return r(e,n,"2","²")}function a(e,n){return r(e,n,"3","³")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixCubes=a,t.fixExponents=function(e,n){return e=a(e=s(e,n),n)},t.fixSquares=s},{}],11:[function(e,n,t){function r(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)(["+n.spaces+"][x]["+n.spaces+"])(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e=(e=e.replace(t,n)).replace(t,n)}function s(e,n){var t="(["+n.allChars+"]+)(["+n.spaces+"][x]["+n.spaces+"])(["+n.allChars+"]+)",t=new RegExp(t,"g"),n="$1"+n.nbsp+n.multiplicationSign+n.nbsp+"$3";return e=(e=e.replace(t,n)).replace(t,n)}function a(e,i){var n="(["+i.cardinalNumber+"])(["+i.spaces+"]?)([x|×])(["+i.spaces+"])(["+i.lowercaseChars+"]+)",n=new RegExp(n,"gi");return e=e.replace(n,function(e,n,t,r,s,a){return""==t?n+t+i.multiplicationSign+i.nbsp+a:n+i.nbsp+i.multiplicationSign+i.nbsp+a})}function i(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?([x|×])(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e.replace(t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMultiplicationSign=function(e,n){return e=i(e=a(e=s(e=r(e,n),n),n),n)},t.fixMultiplicationSignBetweenNumberAndWord=a,t.fixMultiplicationSignBetweenNumbers=r,t.fixMultiplicationSignBetweenWords=s,t.fixNbspAroundMultiplicationSign=i},{}],12:[function(e,n,t){function r(e,n){return e.replace(new RegExp("(["+n.spaces+"]+)("+n.numberSign+")(["+n.spaces+"]+)("+n.cardinalNumber+")","g"),"$1$2$4")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixNumberSign=function(e,n){return e=r(e,n)},t.removeExtraSpacesAfterNumberSign=r},{}],13:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixPlusMinus=function(e,n){var t=new RegExp("(\\+\\-)|(\\-\\+)","g"),n=n.plusMinus;return e.replace(t,n)}},{}],14:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixRegisteredTrademark=function(e,n){return e=((e,n)=>{var t="([^0-9]|^)(["+n.spaces+"]*)(\\(r\\)|"+n.registeredTrademark+")",t=new RegExp(t,"gi"),n="$1"+n.registeredTrademark;return e.replace(t,n)})(e,n)}},{}],15:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSectionSign=function(e,n){return e=((e,n)=>{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],16:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSoundRecordingCopyright=function(e,n){return e=((e,n)=>{var t="(\\(p\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.soundRecordingCopyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.addNbspAfterSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.soundRecordingCopyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":19,"../whitespace/spaces":20}],17:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTrademark=function(e,n){return e=((e,n)=>{var t="(["+n.spaces+"]*)(\\(tm\\)|"+n.trademark+")",t=new RegExp(t,"gi"),n=n.trademark;return e.replace(t,n)})(e,n)}},{}],18:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],19:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function a(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function i(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,i){var n="(\\b["+i.uppercaseChars+"]["+i.lowercaseChars+"]+?)(["+i.spaces+"])(["+i.romanNumerals+"]+\\b)("+i.romanOrdinalIndicator+")(["+i.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,a){return""==a&&"I"==r?n+i.space+r+s:""==a&&"I"!=r?n+i.nbsp+r+s:a==i.nbsp&&"I"==r?n+i.space+r+s+a:n+i.nbsp+r+s+i.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,i){var n=i.uppercaseChars;"en-us"==i.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+i.sentencePunctuation+i.ellipsis+i.closingBrackets+i.rightDoubleQuote+i.rightSingleQuote+i.apostrophe+i.multiplicationSign+i.emDash+i.enDash+"])(["+i.spaces+"])(["+n+"])((["+i.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,a){return"en-us"==i.locale||"I"!=r||a!=i.nbsp&&a!=i.hairSpace&&a!=i.narrowNbsp?n+i.nbsp+r+s:n+i.nbsp+r+i.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=a,t.addNbspAfterCardinalNumber=i,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=i(e=a(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],20:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),a=0;an.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],24:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function a(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function i(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=a,t.fixISBNnumber=i,t.fixISSN=r,t.fixPubId=function(e,n){return e=i(e=a(e=s(e=r(e,n),n),n),n)}},{}],25:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],26:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],27:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],28:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),a=p(e("./en-us")),i=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":a.default,rue:i.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.registeredTrademark="®",this.soundRecordingCopyright="℗",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":25,"./de-de":26,"./en-us":27,"./rue":29,"./sk":30}],29:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],30:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],31:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new a.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,R.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,i.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyright)(e,n),e=(0,$.fixSoundRecordingCopyright)(e,n),e=(0,w.fixPlusMinus)(e,n),e=(0,y.fixRegisteredTrademark)(e,n),e=(0,x.fixTrademark)(e,n),e=(0,_.fixExponents)(e,n),e=(0,v.fixNumberSign)(e,n),e=(0,E.fixCase)(e,n),e=(0,S.fixAbbreviations)(e,n),e=(0,P.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,R.placeExceptions)(e,r)};var a=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},i=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyright"),$=e("./lib/symbols/sound-recording-copyright"),w=e("./lib/symbols/plus-minus"),y=e("./lib/symbols/registered-trademark"),x=e("./lib/symbols/trademark"),_=e("./lib/symbols/exponents"),v=e("./lib/symbols/number-sign"),S=e("./lib/words/abbreviations"),E=e("./lib/words/case"),P=e("./lib/words/pub-id"),R=e("./lib/words/exceptions")},{"./lib/punctuation/dash":2,"./lib/punctuation/double-quotes":3,"./lib/punctuation/ellipsis":4,"./lib/punctuation/hyphen":5,"./lib/punctuation/period":7,"./lib/punctuation/single-quotes":8,"./lib/symbols/copyright":9,"./lib/symbols/exponents":10,"./lib/symbols/multiplication-sign":11,"./lib/symbols/number-sign":12,"./lib/symbols/plus-minus":13,"./lib/symbols/registered-trademark":14,"./lib/symbols/section-sign":15,"./lib/symbols/sound-recording-copyright":16,"./lib/symbols/trademark":17,"./lib/whitespace/lines":18,"./lib/whitespace/nbsp":19,"./lib/whitespace/spaces":20,"./lib/words/abbreviations":21,"./lib/words/case":22,"./lib/words/exceptions":23,"./lib/words/pub-id":24,"./locale/locale":28}]},{},[1]); \ No newline at end of file +!function r(s,i,a){function o(n,e){if(!i[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=i[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,i,a)}return i[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="(\\(c\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.copyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.copyright),e=(0,s.addNbspAfterSymbol)(e,n,n.copyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.copyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":18,"../whitespace/spaces":19}],10:[function(e,n,t){function r(e,n,t,r){n="(["+n.spaces+n.slash+"])(m|dam|hm|km|Mm|Gm|Tm|Pm|Em|Zm|Ym|m|dm|cm|mm|µm|nm|pm|fm|am|zm|ym)("+t+")",t=new RegExp(n,"g");return e.replace(t,"$1$2"+r)}function s(e,n){return r(e,n,"2","²")}function i(e,n){return r(e,n,"3","³")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixCubes=i,t.fixExponents=function(e,n){return e=i(e=s(e,n),n)},t.fixSquares=s},{}],11:[function(e,n,t){function r(e,n,t,r){return e.replace(new RegExp("([^0-9]|^)(["+r.spaces+"]*)(\\("+n+"\\)|"+t+")","gi"),"$1"+t)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMarks=function(e,n){return e=r(e,"r",n.registeredTrademark,n),e=r(e,"sm",n.serviceMark,n),e=r(e,"tm",n.trademark,n)},t.replaceMark=r},{}],12:[function(e,n,t){function r(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)(["+n.spaces+"][x]["+n.spaces+"])(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e=(e=e.replace(t,n)).replace(t,n)}function s(e,n){var t="(["+n.allChars+"]+)(["+n.spaces+"][x]["+n.spaces+"])(["+n.allChars+"]+)",t=new RegExp(t,"g"),n="$1"+n.nbsp+n.multiplicationSign+n.nbsp+"$3";return e=(e=e.replace(t,n)).replace(t,n)}function i(e,a){var n="(["+a.cardinalNumber+"])(["+a.spaces+"]?)([x|×])(["+a.spaces+"])(["+a.lowercaseChars+"]+)",n=new RegExp(n,"gi");return e=e.replace(n,function(e,n,t,r,s,i){return""==t?n+t+a.multiplicationSign+a.nbsp+i:n+a.nbsp+a.multiplicationSign+a.nbsp+i})}function a(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?([x|×])(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e.replace(t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMultiplicationSign=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)},t.fixMultiplicationSignBetweenNumberAndWord=i,t.fixMultiplicationSignBetweenNumbers=r,t.fixMultiplicationSignBetweenWords=s,t.fixNbspAroundMultiplicationSign=a},{}],13:[function(e,n,t){function r(e,n){return e.replace(new RegExp("(["+n.spaces+"]+)("+n.numberSign+")(["+n.spaces+"]+)("+n.cardinalNumber+")","g"),"$1$2$4")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixNumberSign=function(e,n){return e=r(e,n)},t.removeExtraSpacesAfterNumberSign=r},{}],14:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixPlusMinus=function(e,n){var t=new RegExp("(\\+\\-)|(\\-\\+)","g"),n=n.plusMinus;return e.replace(t,n)}},{}],15:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSectionSign=function(e,n){return e=((e,n)=>{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],16:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSoundRecordingCopyright=function(e,n){return e=((e,n)=>{var t="(\\(p\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.soundRecordingCopyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.addNbspAfterSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.soundRecordingCopyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":18,"../whitespace/spaces":19}],17:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],18:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function i(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function a(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,a){var n="(\\b["+a.uppercaseChars+"]["+a.lowercaseChars+"]+?)(["+a.spaces+"])(["+a.romanNumerals+"]+\\b)("+a.romanOrdinalIndicator+")(["+a.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,i){return""==i&&"I"==r?n+a.space+r+s:""==i&&"I"!=r?n+a.nbsp+r+s:i==a.nbsp&&"I"==r?n+a.space+r+s+i:n+a.nbsp+r+s+a.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,a){var n=a.uppercaseChars;"en-us"==a.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+a.sentencePunctuation+a.ellipsis+a.closingBrackets+a.rightDoubleQuote+a.rightSingleQuote+a.apostrophe+a.multiplicationSign+a.emDash+a.enDash+"])(["+a.spaces+"])(["+n+"])((["+a.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,i){return"en-us"==a.locale||"I"!=r||i!=a.nbsp&&i!=a.hairSpace&&i!=a.narrowNbsp?n+a.nbsp+r+s:n+a.nbsp+r+a.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=i,t.addNbspAfterCardinalNumber=a,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=a(e=i(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],19:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),i=0;in.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],23:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function i(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function a(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=i,t.fixISBNnumber=a,t.fixISSN=r,t.fixPubId=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],25:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],26:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],27:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),i=p(e("./en-us")),a=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":i.default,rue:a.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":24,"./de-de":25,"./en-us":26,"./rue":28,"./sk":29}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],29:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],30:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new i.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,P.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,a.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyright)(e,n),e=(0,$.fixSoundRecordingCopyright)(e,n),e=(0,w.fixPlusMinus)(e,n),e=(0,y.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,_.fixNumberSign)(e,n),e=(0,S.fixCase)(e,n),e=(0,v.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,P.placeExceptions)(e,r)};var i=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},a=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyright"),$=e("./lib/symbols/sound-recording-copyright"),w=e("./lib/symbols/plus-minus"),y=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),_=e("./lib/symbols/number-sign"),v=e("./lib/words/abbreviations"),S=e("./lib/words/case"),E=e("./lib/words/pub-id"),P=e("./lib/words/exceptions")},{"./lib/punctuation/dash":2,"./lib/punctuation/double-quotes":3,"./lib/punctuation/ellipsis":4,"./lib/punctuation/hyphen":5,"./lib/punctuation/period":7,"./lib/punctuation/single-quotes":8,"./lib/symbols/copyright":9,"./lib/symbols/exponents":10,"./lib/symbols/marks":11,"./lib/symbols/multiplication-sign":12,"./lib/symbols/number-sign":13,"./lib/symbols/plus-minus":14,"./lib/symbols/section-sign":15,"./lib/symbols/sound-recording-copyright":16,"./lib/whitespace/lines":17,"./lib/whitespace/nbsp":18,"./lib/whitespace/spaces":19,"./lib/words/abbreviations":20,"./lib/words/case":21,"./lib/words/exceptions":22,"./lib/words/pub-id":23,"./locale/locale":27}]},{},[1]); \ No newline at end of file diff --git a/dist/typopo_dist.min.js b/dist/typopo_dist.min.js index 79385c9..4dd67bf 100644 --- a/dist/typopo_dist.min.js +++ b/dist/typopo_dist.min.js @@ -3,4 +3,4 @@ * Copyright 2015–2024 Braňo Šandala (https://brano.me) * Licensed under MIT (https://github.com/surfinzap/typopo/blob/main/LICENSE.txt) */ -!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).typopo=e()}(function(){return function r(i,s,a){function o(n,e){if(!s[n]){if(!i[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=s[n]={exports:{}},i[n][0].call(t.exports,function(e){return o(i[n][1][e]||e)},t,t.exports,r,i,s,a)}return s[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="(\\(c\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.copyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.copyright),e=(0,i.addNbspAfterSymbol)(e,n,n.copyright),e=(0,i.replaceSpacesWithNbspAfterSymbol)(e,n,n.copyright)};var r=e("../whitespace/spaces"),i=e("../whitespace/nbsp")},{"../whitespace/nbsp":18,"../whitespace/spaces":19}],9:[function(e,n,t){function r(e,n,t,r){n="(["+n.spaces+n.slash+"])(m|dam|hm|km|Mm|Gm|Tm|Pm|Em|Zm|Ym|m|dm|cm|mm|µm|nm|pm|fm|am|zm|ym)("+t+")",t=new RegExp(n,"g");return e.replace(t,"$1$2"+r)}function i(e,n){return r(e,n,"2","²")}function s(e,n){return r(e,n,"3","³")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixCubes=s,t.fixExponents=function(e,n){return e=s(e=i(e,n),n)},t.fixSquares=i},{}],10:[function(e,n,t){function r(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)(["+n.spaces+"][x]["+n.spaces+"])(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e=(e=e.replace(t,n)).replace(t,n)}function i(e,n){var t="(["+n.allChars+"]+)(["+n.spaces+"][x]["+n.spaces+"])(["+n.allChars+"]+)",t=new RegExp(t,"g"),n="$1"+n.nbsp+n.multiplicationSign+n.nbsp+"$3";return e=(e=e.replace(t,n)).replace(t,n)}function s(e,a){var n="(["+a.cardinalNumber+"])(["+a.spaces+"]?)([x|×])(["+a.spaces+"])(["+a.lowercaseChars+"]+)",n=new RegExp(n,"gi");return e=e.replace(n,function(e,n,t,r,i,s){return""==t?n+t+a.multiplicationSign+a.nbsp+s:n+a.nbsp+a.multiplicationSign+a.nbsp+s})}function a(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?([x|×])(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e.replace(t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMultiplicationSign=function(e,n){return e=a(e=s(e=i(e=r(e,n),n),n),n)},t.fixMultiplicationSignBetweenNumberAndWord=s,t.fixMultiplicationSignBetweenNumbers=r,t.fixMultiplicationSignBetweenWords=i,t.fixNbspAroundMultiplicationSign=a},{}],11:[function(e,n,t){function r(e,n){return e.replace(new RegExp("(["+n.spaces+"]+)("+n.numberSign+")(["+n.spaces+"]+)("+n.cardinalNumber+")","g"),"$1$2$4")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixNumberSign=function(e,n){return e=r(e,n)},t.removeExtraSpacesAfterNumberSign=r},{}],12:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixPlusMinus=function(e,n){var t=new RegExp("(\\+\\-)|(\\-\\+)","g"),n=n.plusMinus;return e.replace(t,n)}},{}],13:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixRegisteredTrademark=function(e,n){return e=((e,n)=>{var t="([^0-9]|^)(["+n.spaces+"]*)(\\(r\\)|"+n.registeredTrademark+")",t=new RegExp(t,"gi"),n="$1"+n.registeredTrademark;return e.replace(t,n)})(e,n)}},{}],14:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSectionSign=function(e,n){return e=((e,n)=>{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],15:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSoundRecordingCopyright=function(e,n){return e=((e,n)=>{var t="(\\(p\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.soundRecordingCopyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.soundRecordingCopyright),e=(0,i.addNbspAfterSymbol)(e,n,n.soundRecordingCopyright),e=(0,i.replaceSpacesWithNbspAfterSymbol)(e,n,n.soundRecordingCopyright)};var r=e("../whitespace/spaces"),i=e("../whitespace/nbsp")},{"../whitespace/nbsp":18,"../whitespace/spaces":19}],16:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTrademark=function(e,n){return e=((e,n)=>{var t="(["+n.spaces+"]*)(\\(tm\\)|"+n.trademark+")",t=new RegExp(t,"gi"),n=n.trademark;return e.replace(t,n)})(e,n)}},{}],17:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],18:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function i(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),i="$1$2"+n.nbsp;return e=(e=e.replace(r,i)).replace(r,i),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),i="$1$2$3"+n.nbsp,e=e.replace(r,i),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function s(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function a(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,a){var n="(\\b["+a.uppercaseChars+"]["+a.lowercaseChars+"]+?)(["+a.spaces+"])(["+a.romanNumerals+"]+\\b)("+a.romanOrdinalIndicator+")(["+a.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,i,s){return""==s&&"I"==r?n+a.space+r+i:""==s&&"I"!=r?n+a.nbsp+r+i:s==a.nbsp&&"I"==r?n+a.space+r+i+s:n+a.nbsp+r+i+a.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,a){var n=a.uppercaseChars;"en-us"==a.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+a.sentencePunctuation+a.ellipsis+a.closingBrackets+a.rightDoubleQuote+a.rightSingleQuote+a.apostrophe+a.multiplicationSign+a.emDash+a.enDash+"])(["+a.spaces+"])(["+n+"])((["+a.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,i,s){return"en-us"==a.locale||"I"!=r||s!=a.nbsp&&s!=a.hairSpace&&s!=a.narrowNbsp?n+a.nbsp+r+i:n+a.nbsp+r+a.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=s,t.addNbspAfterCardinalNumber=a,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=i,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=a(e=s(e=i(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],19:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function i(e,n,r){for(var t=e.split(/\r?\n/),i=new RegExp("(^\\s+)([-\\*\\+]*)","g"),s=0;sn.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],23:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function i(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function a(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=i,t.fixISBN13=s,t.fixISBNnumber=a,t.fixISSN=r,t.fixPubId=function(e,n){return e=a(e=s(e=i(e=r(e,n),n),n),n)}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],25:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],26:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],27:[function(e,n,t){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),s=p(e("./en-us")),a=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=i(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==i(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":s.default,rue:a.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.registeredTrademark="®",this.soundRecordingCopyright="℗",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":24,"./de-de":25,"./en-us":26,"./rue":28,"./sk":29}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],29:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],30:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new s.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,R.excludeExceptions)(e,n)),i=r.processedText,r=r.exceptions;e=i,t.removeLines&&(e=(0,a.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,b.fixMultiplicationSign)(e,n),e=(0,h.fixSectionSign)(e,n),e=(0,m.fixCopyright)(e,n),e=(0,$.fixSoundRecordingCopyright)(e,n),e=(0,w.fixPlusMinus)(e,n),e=(0,y.fixRegisteredTrademark)(e,n),e=(0,x.fixTrademark)(e,n),e=(0,_.fixExponents)(e,n),e=(0,v.fixNumberSign)(e,n),e=(0,E.fixCase)(e,n),e=(0,S.fixAbbreviations)(e,n),e=(0,P.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,R.placeExceptions)(e,r)};var s=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},a=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),b=e("./lib/symbols/multiplication-sign"),h=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyright"),$=e("./lib/symbols/sound-recording-copyright"),w=e("./lib/symbols/plus-minus"),y=e("./lib/symbols/registered-trademark"),x=e("./lib/symbols/trademark"),_=e("./lib/symbols/exponents"),v=e("./lib/symbols/number-sign"),S=e("./lib/words/abbreviations"),E=e("./lib/words/case"),P=e("./lib/words/pub-id"),R=e("./lib/words/exceptions")},{"./lib/punctuation/dash":1,"./lib/punctuation/double-quotes":2,"./lib/punctuation/ellipsis":3,"./lib/punctuation/hyphen":4,"./lib/punctuation/period":6,"./lib/punctuation/single-quotes":7,"./lib/symbols/copyright":8,"./lib/symbols/exponents":9,"./lib/symbols/multiplication-sign":10,"./lib/symbols/number-sign":11,"./lib/symbols/plus-minus":12,"./lib/symbols/registered-trademark":13,"./lib/symbols/section-sign":14,"./lib/symbols/sound-recording-copyright":15,"./lib/symbols/trademark":16,"./lib/whitespace/lines":17,"./lib/whitespace/nbsp":18,"./lib/whitespace/spaces":19,"./lib/words/abbreviations":20,"./lib/words/case":21,"./lib/words/exceptions":22,"./lib/words/pub-id":23,"./locale/locale":27}]},{},[30])(30)}); \ No newline at end of file +!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).typopo=e()}(function(){return function r(s,i,a){function o(n,e){if(!i[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=i[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,i,a)}return i[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="(\\(c\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.copyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.copyright),e=(0,s.addNbspAfterSymbol)(e,n,n.copyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.copyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":17,"../whitespace/spaces":18}],9:[function(e,n,t){function r(e,n,t,r){n="(["+n.spaces+n.slash+"])(m|dam|hm|km|Mm|Gm|Tm|Pm|Em|Zm|Ym|m|dm|cm|mm|µm|nm|pm|fm|am|zm|ym)("+t+")",t=new RegExp(n,"g");return e.replace(t,"$1$2"+r)}function s(e,n){return r(e,n,"2","²")}function i(e,n){return r(e,n,"3","³")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixCubes=i,t.fixExponents=function(e,n){return e=i(e=s(e,n),n)},t.fixSquares=s},{}],10:[function(e,n,t){function r(e,n,t,r){return e.replace(new RegExp("([^0-9]|^)(["+r.spaces+"]*)(\\("+n+"\\)|"+t+")","gi"),"$1"+t)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMarks=function(e,n){return e=r(e,"r",n.registeredTrademark,n),e=r(e,"sm",n.serviceMark,n),e=r(e,"tm",n.trademark,n)},t.replaceMark=r},{}],11:[function(e,n,t){function r(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)(["+n.spaces+"][x]["+n.spaces+"])(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e=(e=e.replace(t,n)).replace(t,n)}function s(e,n){var t="(["+n.allChars+"]+)(["+n.spaces+"][x]["+n.spaces+"])(["+n.allChars+"]+)",t=new RegExp(t,"g"),n="$1"+n.nbsp+n.multiplicationSign+n.nbsp+"$3";return e=(e=e.replace(t,n)).replace(t,n)}function i(e,a){var n="(["+a.cardinalNumber+"])(["+a.spaces+"]?)([x|×])(["+a.spaces+"])(["+a.lowercaseChars+"]+)",n=new RegExp(n,"gi");return e=e.replace(n,function(e,n,t,r,s,i){return""==t?n+t+a.multiplicationSign+a.nbsp+i:n+a.nbsp+a.multiplicationSign+a.nbsp+i})}function a(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?([x|×])(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e.replace(t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMultiplicationSign=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)},t.fixMultiplicationSignBetweenNumberAndWord=i,t.fixMultiplicationSignBetweenNumbers=r,t.fixMultiplicationSignBetweenWords=s,t.fixNbspAroundMultiplicationSign=a},{}],12:[function(e,n,t){function r(e,n){return e.replace(new RegExp("(["+n.spaces+"]+)("+n.numberSign+")(["+n.spaces+"]+)("+n.cardinalNumber+")","g"),"$1$2$4")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixNumberSign=function(e,n){return e=r(e,n)},t.removeExtraSpacesAfterNumberSign=r},{}],13:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixPlusMinus=function(e,n){var t=new RegExp("(\\+\\-)|(\\-\\+)","g"),n=n.plusMinus;return e.replace(t,n)}},{}],14:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSectionSign=function(e,n){return e=((e,n)=>{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],15:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSoundRecordingCopyright=function(e,n){return e=((e,n)=>{var t="(\\(p\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.soundRecordingCopyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.addNbspAfterSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.soundRecordingCopyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":17,"../whitespace/spaces":18}],16:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],17:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function i(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function a(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,a){var n="(\\b["+a.uppercaseChars+"]["+a.lowercaseChars+"]+?)(["+a.spaces+"])(["+a.romanNumerals+"]+\\b)("+a.romanOrdinalIndicator+")(["+a.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,i){return""==i&&"I"==r?n+a.space+r+s:""==i&&"I"!=r?n+a.nbsp+r+s:i==a.nbsp&&"I"==r?n+a.space+r+s+i:n+a.nbsp+r+s+a.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,a){var n=a.uppercaseChars;"en-us"==a.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+a.sentencePunctuation+a.ellipsis+a.closingBrackets+a.rightDoubleQuote+a.rightSingleQuote+a.apostrophe+a.multiplicationSign+a.emDash+a.enDash+"])(["+a.spaces+"])(["+n+"])((["+a.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,i){return"en-us"==a.locale||"I"!=r||i!=a.nbsp&&i!=a.hairSpace&&i!=a.narrowNbsp?n+a.nbsp+r+s:n+a.nbsp+r+a.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=i,t.addNbspAfterCardinalNumber=a,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=a(e=i(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],18:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),i=0;in.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],22:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function i(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function a(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=i,t.fixISBNnumber=a,t.fixISSN=r,t.fixPubId=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)}},{}],23:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],25:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],26:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),i=p(e("./en-us")),a=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":i.default,rue:a.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":23,"./de-de":24,"./en-us":25,"./rue":27,"./sk":28}],27:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],29:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new i.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,P.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,a.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyright)(e,n),e=(0,$.fixSoundRecordingCopyright)(e,n),e=(0,w.fixPlusMinus)(e,n),e=(0,y.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,_.fixNumberSign)(e,n),e=(0,S.fixCase)(e,n),e=(0,v.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,P.placeExceptions)(e,r)};var i=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},a=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyright"),$=e("./lib/symbols/sound-recording-copyright"),w=e("./lib/symbols/plus-minus"),y=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),_=e("./lib/symbols/number-sign"),v=e("./lib/words/abbreviations"),S=e("./lib/words/case"),E=e("./lib/words/pub-id"),P=e("./lib/words/exceptions")},{"./lib/punctuation/dash":1,"./lib/punctuation/double-quotes":2,"./lib/punctuation/ellipsis":3,"./lib/punctuation/hyphen":4,"./lib/punctuation/period":6,"./lib/punctuation/single-quotes":7,"./lib/symbols/copyright":8,"./lib/symbols/exponents":9,"./lib/symbols/marks":10,"./lib/symbols/multiplication-sign":11,"./lib/symbols/number-sign":12,"./lib/symbols/plus-minus":13,"./lib/symbols/section-sign":14,"./lib/symbols/sound-recording-copyright":15,"./lib/whitespace/lines":16,"./lib/whitespace/nbsp":17,"./lib/whitespace/spaces":18,"./lib/words/abbreviations":19,"./lib/words/case":20,"./lib/words/exceptions":21,"./lib/words/pub-id":22,"./locale/locale":26}]},{},[29])(29)}); \ No newline at end of file diff --git a/src/lib/examples.js b/src/lib/examples.js index b01ca3a..fe0630f 100644 --- a/src/lib/examples.js +++ b/src/lib/examples.js @@ -63,7 +63,7 @@ export function withFunctionInReturn(string, locale) { /* test */ -describe('Test case (en):\n', () => { +describe('Test case (en-us):\n', () => { let testCase = { ...somePartialTestCase, }; diff --git a/src/lib/symbols/marks.js b/src/lib/symbols/marks.js new file mode 100644 index 0000000..4d7889a --- /dev/null +++ b/src/lib/symbols/marks.js @@ -0,0 +1,43 @@ + +/** + * Replaces occurrences of a specific mark in a string. + * + * Example: Company (tm) -> Company™ + * + * @param {string} string - The input string where marks will be replaced. + * @param {Object} locale - An object w/ locale-specific symbols. + * @param {string} markPattern - The pattern for the mark (e.g., “tm” for trademark). + * @param {string} replacementMark - The symbol to replace the pattern with (e.g., “™” for trademark). + * @returns {string} - The string with the specified marks replaced. + */ + +export function replaceMark(string, markPattern, replacementMark, locale) { + return string.replace( + new RegExp( + "([^0-9]|^)" + + "([" + locale.spaces + "]*)" + + "(\\(" + markPattern + "\\)|" + replacementMark + ")", + "gi" + ), + "$1" + replacementMark + ); +} + + + +/** + * Fixes occurrences of registered trademark (®), service mark (℠) and trademark (™) in a given string. + * + * @param {string} string - The input string to be fixed. + * @param {Object} locale - An object w/ locale-specific symbols + * @returns {string} - The string with marks replaced. + */ + +export function fixMarks(string, locale) { + + string = replaceMark(string, "r", locale.registeredTrademark, locale); + string = replaceMark(string, "sm", locale.serviceMark, locale); + string = replaceMark(string, "tm", locale.trademark, locale); + + return string; +} \ No newline at end of file diff --git a/src/lib/symbols/registered-trademark.js b/src/lib/symbols/registered-trademark.js deleted file mode 100644 index 49f553d..0000000 --- a/src/lib/symbols/registered-trademark.js +++ /dev/null @@ -1,15 +0,0 @@ -function replaceRwithRegisteredTrademark(string, locale) { - let pattern = "([^0-9]|^)([" + locale.spaces + "]*)(\\(r\\)|" + locale.registeredTrademark +")"; - let re = new RegExp(pattern, "gi"); - let replacement = "$1" + locale.registeredTrademark; - - return string.replace(re, replacement); -} - - - -export function fixRegisteredTrademark(string, locale) { - string = replaceRwithRegisteredTrademark(string, locale); - - return string -} diff --git a/src/lib/symbols/trademark.js b/src/lib/symbols/trademark.js deleted file mode 100644 index 3b18d12..0000000 --- a/src/lib/symbols/trademark.js +++ /dev/null @@ -1,15 +0,0 @@ -function replaceTMwithTrademark(string, locale) { - let pattern = "([" + locale.spaces + "]*)(\\(tm\\)|" + locale.trademark +")"; - let re = new RegExp(pattern, "gi"); - let replacement = locale.trademark; - - return string.replace(re, replacement); -} - - - -export function fixTrademark(string, locale) { - string = replaceTMwithTrademark(string, locale); - - return string -} diff --git a/src/locale/locale.js b/src/locale/locale.js index 0cc64bf..2ea7d7c 100644 --- a/src/locale/locale.js +++ b/src/locale/locale.js @@ -78,8 +78,9 @@ export default class Locale { this.ampersand = "&"; this.sectionSign = "§"; this.copyright = "©"; - this.registeredTrademark = "®"; this.soundRecordingCopyright = "℗"; + this.registeredTrademark = "®"; + this.serviceMark = "℠"; this.trademark = "™"; this.plus = "+"; this.minus = "−"; diff --git a/src/test/integration/typopo.test.js b/src/test/integration/typopo.test.js index d9f9db1..8ef54c6 100644 --- a/src/test/integration/typopo.test.js +++ b/src/test/integration/typopo.test.js @@ -103,8 +103,13 @@ let testModules = { "Company (p)2017": "Company ℗ 2017", //registered trademark "Company (r)": "Company®", + "Company ( r )": "Company®", + //service trademark + "Company (sm)": "Company℠", + "Company ( sm )": "Company℠", // trademark "Company (tm)": "Company™", + "Company ( tm )": "Company™", // number sign "word # 9": "word #9", diff --git a/src/test/symbols/marks.test.js b/src/test/symbols/marks.test.js new file mode 100644 index 0000000..57460da --- /dev/null +++ b/src/test/symbols/marks.test.js @@ -0,0 +1,90 @@ +import {replaceMark, fixMarks} from "../../lib/symbols/marks"; +import assert from 'assert'; +import Locale from "../../locale/locale"; + +const locales = ["en-us", "de-de", "sk", "cs", "rue"]; + +const registeredTrademark = { + "(r)": "®", + "(R)": "®", + "Company (r)": "Company®", + "Company ®": "Company®", + "Company (r)": "Company®", + "Company ®": "Company®", + "Company (r)": "Company®", + "Company ®": "Company®", + // false positives + "Item (R-1000)" : "Item (R-1000)", + "Section 7(r)": "Section 7(r)", +} + +const serviceMark = { + "(sm)": "℠", + "(SM)": "℠", + "Company (sm)": "Company℠", + "Company ℠": "Company℠", + "Company (sm)": "Company℠", + "Company ℠": "Company℠", + "Company (sm)": "Company℠", + "Company ℠": "Company℠", + // false positives + "Item (SM-1000)" : "Item (SM-1000)", + "Section 7(s)" : "Section 7(s)", +}; + +const trademark = { + "(tm)": "™", + "(TM)": "™", + "Company (tm)": "Company™", + "Company ™": "Company™", + "Company (tm)": "Company™", + "Company ™": "Company™", + "Company (tm)": "Company™", + "Company ™": "Company™", + // false positives + "Item (TM-1000)" : "Item (TM-1000)", + "Section 7(t)" : "Section 7(t)", +}; + + +function testMarks(testCase, markPattern, replacementMark) { + locales.forEach(function(locale) { + Object.keys(testCase).forEach((key) => { + it(`unit test, ${replacementMark}, ${locale}`, () => { + assert.strictEqual( + replaceMark( + key, + markPattern, + replacementMark, + new Locale(locale) + ), + testCase[key] + ); + }); + + it(`module test, ${replacementMark}, ${locale}`, () => { + assert.strictEqual( + fixMarks( + key, + new Locale(locale)), + testCase[key] + ); + }); + }); + }); + +} + + + +describe('Fix registered trademark (®):\n', () => { + testMarks(registeredTrademark, "r", "®"); +}); + +describe('Fix service mark (℠):\n', () => { + testMarks(serviceMark, "sm", "℠"); +}); + +describe('Fix trademark (™):\n', () => { + testMarks(trademark, "tm", "™"); +}); diff --git a/src/test/symbols/registered-trademark.test.js b/src/test/symbols/registered-trademark.test.js deleted file mode 100644 index 9846b0a..0000000 --- a/src/test/symbols/registered-trademark.test.js +++ /dev/null @@ -1,33 +0,0 @@ -import { fixRegisteredTrademark } from "../../lib/symbols/registered-trademark"; -import { fixTypos } from "../../typopo"; -import assert from 'assert'; -import Locale from "../../locale/locale"; - -describe('Fix registered trademark ®\n', () => { - let testCase = { - "(r)": "®", - "(R)": "®", - "Company (r)": "Company®", - "Company ®": "Company®", - "Section 7(r)": "Section 7(r)", - }; - - Object.keys(testCase).forEach((key) => { - it("unit test", () => { - assert.strictEqual(fixRegisteredTrademark(key, new Locale("en-us")), testCase[key]); - }); - }); -}); - - -describe('Fix registered trademark ®\n', () => { - let testCase = { - "( r )": "®" - }; - - Object.keys(testCase).forEach((key) => { - it("integration test", () => { - assert.strictEqual(fixTypos(key, "en-us"), testCase[key]); - }); - }); -}); \ No newline at end of file diff --git a/src/test/symbols/trademark.test.js b/src/test/symbols/trademark.test.js deleted file mode 100644 index c582347..0000000 --- a/src/test/symbols/trademark.test.js +++ /dev/null @@ -1,31 +0,0 @@ -import {fixTrademark} from "../../lib/symbols/trademark"; -import {fixTypos} from "../../typopo"; -import assert from 'assert'; -import Locale from "../../locale/locale"; - -describe('Fix trademark ™\n', () => { - let testCase = { - "(tm)": "™", - "(TM)": "™", - "Company (tm)": "Company™", - "Company ™": "Company™", - }; - - Object.keys(testCase).forEach((key) => { - it("", () => { - assert.strictEqual(fixTrademark(key, new Locale("en-us")), testCase[key]); - }); - }); -}); - -describe('Fix trademark ™\n', () => { - let testCase = { - "( tm )": "™", - }; - - Object.keys(testCase).forEach((key) => { - it("integration test", () => { - assert.strictEqual(fixTypos(key, "en-us"), testCase[key]); - }); - }); -}); \ No newline at end of file diff --git a/src/typopo.js b/src/typopo.js index 455dc7f..ed4ec6d 100644 --- a/src/typopo.js +++ b/src/typopo.js @@ -18,8 +18,7 @@ import {fixSectionSign} from "./lib/symbols/section-sign"; import {fixCopyright} from "./lib/symbols/copyright"; import {fixSoundRecordingCopyright} from "./lib/symbols/sound-recording-copyright"; import {fixPlusMinus} from "./lib/symbols/plus-minus"; -import {fixRegisteredTrademark} from "./lib/symbols/registered-trademark"; -import {fixTrademark} from "./lib/symbols/trademark"; +import {fixMarks} from "./lib/symbols/marks"; import {fixExponents} from "./lib/symbols/exponents"; import {fixNumberSign} from "./lib/symbols/number-sign"; import {fixAbbreviations} from "./lib/words/abbreviations"; @@ -76,8 +75,7 @@ export function fixTypos(string, locale, configuration) { string = fixCopyright(string, currentLocale); string = fixSoundRecordingCopyright(string, currentLocale); string = fixPlusMinus(string, currentLocale); - string = fixRegisteredTrademark(string, currentLocale); - string = fixTrademark(string, currentLocale); + string = fixMarks(string, currentLocale); string = fixExponents(string, currentLocale); string = fixNumberSign(string, currentLocale); From 347bbf01ee340b733a6e4f0a8b82fcac8a04375b Mon Sep 17 00:00:00 2001 From: Brano Sandala Date: Sun, 22 Sep 2024 10:48:17 +0200 Subject: [PATCH 2/5] Copyrights --- CHANGELOG.md | 3 +- dist/typopo.min.js | 2 +- dist/typopo_dist.min.js | 2 +- src/lib/symbols/copyright.js | 22 ------- src/lib/symbols/copyrights.js | 60 +++++++++++++++++ src/lib/symbols/marks.js | 5 +- src/lib/symbols/sound-recording-copyright.js | 23 ------- src/test/integration/typopo.test.js | 17 +++++ src/test/symbols/copyright.test.js | 38 ----------- src/test/symbols/copyrights.test.js | 65 +++++++++++++++++++ src/test/symbols/marks.test.js | 1 - .../symbols/sound-recording-copyright.test.js | 23 ------- src/typopo.js | 6 +- 13 files changed, 149 insertions(+), 118 deletions(-) delete mode 100644 src/lib/symbols/copyright.js create mode 100644 src/lib/symbols/copyrights.js delete mode 100644 src/lib/symbols/sound-recording-copyright.js delete mode 100644 src/test/symbols/copyright.test.js create mode 100644 src/test/symbols/copyrights.test.js delete mode 100644 src/test/symbols/sound-recording-copyright.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index d595834..56e1d7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ ### 🔨 Maintenance - Add a build automation - Automate copyright notice updates in source and dist files -- Refactor code for Registered Trademark (®) and Trademark (™) +- Refactor code for Registered Trademark (®), Trademark (™), Copyright (©), and Sound Recording Copyright (℗) +- diff --git a/dist/typopo.min.js b/dist/typopo.min.js index 29a9b45..e58d959 100644 --- a/dist/typopo.min.js +++ b/dist/typopo.min.js @@ -3,4 +3,4 @@ * Copyright 2015–2024 Braňo Šandala (https://brano.me) * Licensed under MIT (https://github.com/surfinzap/typopo/blob/main/LICENSE.txt) */ -!function r(s,i,a){function o(n,e){if(!i[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=i[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,i,a)}return i[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="(\\(c\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.copyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.copyright),e=(0,s.addNbspAfterSymbol)(e,n,n.copyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.copyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":18,"../whitespace/spaces":19}],10:[function(e,n,t){function r(e,n,t,r){n="(["+n.spaces+n.slash+"])(m|dam|hm|km|Mm|Gm|Tm|Pm|Em|Zm|Ym|m|dm|cm|mm|µm|nm|pm|fm|am|zm|ym)("+t+")",t=new RegExp(n,"g");return e.replace(t,"$1$2"+r)}function s(e,n){return r(e,n,"2","²")}function i(e,n){return r(e,n,"3","³")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixCubes=i,t.fixExponents=function(e,n){return e=i(e=s(e,n),n)},t.fixSquares=s},{}],11:[function(e,n,t){function r(e,n,t,r){return e.replace(new RegExp("([^0-9]|^)(["+r.spaces+"]*)(\\("+n+"\\)|"+t+")","gi"),"$1"+t)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMarks=function(e,n){return e=r(e,"r",n.registeredTrademark,n),e=r(e,"sm",n.serviceMark,n),e=r(e,"tm",n.trademark,n)},t.replaceMark=r},{}],12:[function(e,n,t){function r(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)(["+n.spaces+"][x]["+n.spaces+"])(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e=(e=e.replace(t,n)).replace(t,n)}function s(e,n){var t="(["+n.allChars+"]+)(["+n.spaces+"][x]["+n.spaces+"])(["+n.allChars+"]+)",t=new RegExp(t,"g"),n="$1"+n.nbsp+n.multiplicationSign+n.nbsp+"$3";return e=(e=e.replace(t,n)).replace(t,n)}function i(e,a){var n="(["+a.cardinalNumber+"])(["+a.spaces+"]?)([x|×])(["+a.spaces+"])(["+a.lowercaseChars+"]+)",n=new RegExp(n,"gi");return e=e.replace(n,function(e,n,t,r,s,i){return""==t?n+t+a.multiplicationSign+a.nbsp+i:n+a.nbsp+a.multiplicationSign+a.nbsp+i})}function a(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?([x|×])(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e.replace(t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMultiplicationSign=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)},t.fixMultiplicationSignBetweenNumberAndWord=i,t.fixMultiplicationSignBetweenNumbers=r,t.fixMultiplicationSignBetweenWords=s,t.fixNbspAroundMultiplicationSign=a},{}],13:[function(e,n,t){function r(e,n){return e.replace(new RegExp("(["+n.spaces+"]+)("+n.numberSign+")(["+n.spaces+"]+)("+n.cardinalNumber+")","g"),"$1$2$4")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixNumberSign=function(e,n){return e=r(e,n)},t.removeExtraSpacesAfterNumberSign=r},{}],14:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixPlusMinus=function(e,n){var t=new RegExp("(\\+\\-)|(\\-\\+)","g"),n=n.plusMinus;return e.replace(t,n)}},{}],15:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSectionSign=function(e,n){return e=((e,n)=>{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],16:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSoundRecordingCopyright=function(e,n){return e=((e,n)=>{var t="(\\(p\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.soundRecordingCopyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.addNbspAfterSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.soundRecordingCopyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":18,"../whitespace/spaces":19}],17:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],18:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function i(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function a(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,a){var n="(\\b["+a.uppercaseChars+"]["+a.lowercaseChars+"]+?)(["+a.spaces+"])(["+a.romanNumerals+"]+\\b)("+a.romanOrdinalIndicator+")(["+a.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,i){return""==i&&"I"==r?n+a.space+r+s:""==i&&"I"!=r?n+a.nbsp+r+s:i==a.nbsp&&"I"==r?n+a.space+r+s+i:n+a.nbsp+r+s+a.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,a){var n=a.uppercaseChars;"en-us"==a.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+a.sentencePunctuation+a.ellipsis+a.closingBrackets+a.rightDoubleQuote+a.rightSingleQuote+a.apostrophe+a.multiplicationSign+a.emDash+a.enDash+"])(["+a.spaces+"])(["+n+"])((["+a.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,i){return"en-us"==a.locale||"I"!=r||i!=a.nbsp&&i!=a.hairSpace&&i!=a.narrowNbsp?n+a.nbsp+r+s:n+a.nbsp+r+a.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=i,t.addNbspAfterCardinalNumber=a,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=a(e=i(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],19:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),i=0;in.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],23:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function i(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function a(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=i,t.fixISBNnumber=a,t.fixISSN=r,t.fixPubId=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],25:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],26:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],27:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),i=p(e("./en-us")),a=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":i.default,rue:a.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":24,"./de-de":25,"./en-us":26,"./rue":28,"./sk":29}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],29:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],30:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new i.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,P.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,a.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyright)(e,n),e=(0,$.fixSoundRecordingCopyright)(e,n),e=(0,w.fixPlusMinus)(e,n),e=(0,y.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,_.fixNumberSign)(e,n),e=(0,S.fixCase)(e,n),e=(0,v.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,P.placeExceptions)(e,r)};var i=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},a=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyright"),$=e("./lib/symbols/sound-recording-copyright"),w=e("./lib/symbols/plus-minus"),y=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),_=e("./lib/symbols/number-sign"),v=e("./lib/words/abbreviations"),S=e("./lib/words/case"),E=e("./lib/words/pub-id"),P=e("./lib/words/exceptions")},{"./lib/punctuation/dash":2,"./lib/punctuation/double-quotes":3,"./lib/punctuation/ellipsis":4,"./lib/punctuation/hyphen":5,"./lib/punctuation/period":7,"./lib/punctuation/single-quotes":8,"./lib/symbols/copyright":9,"./lib/symbols/exponents":10,"./lib/symbols/marks":11,"./lib/symbols/multiplication-sign":12,"./lib/symbols/number-sign":13,"./lib/symbols/plus-minus":14,"./lib/symbols/section-sign":15,"./lib/symbols/sound-recording-copyright":16,"./lib/whitespace/lines":17,"./lib/whitespace/nbsp":18,"./lib/whitespace/spaces":19,"./lib/words/abbreviations":20,"./lib/words/case":21,"./lib/words/exceptions":22,"./lib/words/pub-id":23,"./locale/locale":27}]},{},[1]); \ No newline at end of file +!function r(s,a,i){function o(n,e){if(!a[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=a[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,a,i)}return a[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],16:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],17:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function a(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function i(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,i){var n="(\\b["+i.uppercaseChars+"]["+i.lowercaseChars+"]+?)(["+i.spaces+"])(["+i.romanNumerals+"]+\\b)("+i.romanOrdinalIndicator+")(["+i.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,a){return""==a&&"I"==r?n+i.space+r+s:""==a&&"I"!=r?n+i.nbsp+r+s:a==i.nbsp&&"I"==r?n+i.space+r+s+a:n+i.nbsp+r+s+i.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,i){var n=i.uppercaseChars;"en-us"==i.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+i.sentencePunctuation+i.ellipsis+i.closingBrackets+i.rightDoubleQuote+i.rightSingleQuote+i.apostrophe+i.multiplicationSign+i.emDash+i.enDash+"])(["+i.spaces+"])(["+n+"])((["+i.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,a){return"en-us"==i.locale||"I"!=r||a!=i.nbsp&&a!=i.hairSpace&&a!=i.narrowNbsp?n+i.nbsp+r+s:n+i.nbsp+r+i.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=a,t.addNbspAfterCardinalNumber=i,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=i(e=a(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],18:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),a=0;an.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],22:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function a(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function i(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=a,t.fixISBNnumber=i,t.fixISSN=r,t.fixPubId=function(e,n){return e=i(e=a(e=s(e=r(e,n),n),n),n)}},{}],23:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],25:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],26:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),a=p(e("./en-us")),i=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":a.default,rue:i.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":23,"./de-de":24,"./en-us":25,"./rue":27,"./sk":28}],27:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],29:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new a.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,S.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,i.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyrights)(e,n),e=(0,$.fixPlusMinus)(e,n),e=(0,w.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,y.fixNumberSign)(e,n),e=(0,v.fixCase)(e,n),e=(0,_.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,S.placeExceptions)(e,r)};var a=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},i=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyrights"),$=e("./lib/symbols/plus-minus"),w=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),y=e("./lib/symbols/number-sign"),_=e("./lib/words/abbreviations"),v=e("./lib/words/case"),E=e("./lib/words/pub-id"),S=e("./lib/words/exceptions")},{"./lib/punctuation/dash":2,"./lib/punctuation/double-quotes":3,"./lib/punctuation/ellipsis":4,"./lib/punctuation/hyphen":5,"./lib/punctuation/period":7,"./lib/punctuation/single-quotes":8,"./lib/symbols/copyrights":9,"./lib/symbols/exponents":10,"./lib/symbols/marks":11,"./lib/symbols/multiplication-sign":12,"./lib/symbols/number-sign":13,"./lib/symbols/plus-minus":14,"./lib/symbols/section-sign":15,"./lib/whitespace/lines":16,"./lib/whitespace/nbsp":17,"./lib/whitespace/spaces":18,"./lib/words/abbreviations":19,"./lib/words/case":20,"./lib/words/exceptions":21,"./lib/words/pub-id":22,"./locale/locale":26}]},{},[1]); \ No newline at end of file diff --git a/dist/typopo_dist.min.js b/dist/typopo_dist.min.js index 4dd67bf..b2714ca 100644 --- a/dist/typopo_dist.min.js +++ b/dist/typopo_dist.min.js @@ -3,4 +3,4 @@ * Copyright 2015–2024 Braňo Šandala (https://brano.me) * Licensed under MIT (https://github.com/surfinzap/typopo/blob/main/LICENSE.txt) */ -!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).typopo=e()}(function(){return function r(s,i,a){function o(n,e){if(!i[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=i[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,i,a)}return i[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="(\\(c\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.copyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.copyright),e=(0,s.addNbspAfterSymbol)(e,n,n.copyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.copyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":17,"../whitespace/spaces":18}],9:[function(e,n,t){function r(e,n,t,r){n="(["+n.spaces+n.slash+"])(m|dam|hm|km|Mm|Gm|Tm|Pm|Em|Zm|Ym|m|dm|cm|mm|µm|nm|pm|fm|am|zm|ym)("+t+")",t=new RegExp(n,"g");return e.replace(t,"$1$2"+r)}function s(e,n){return r(e,n,"2","²")}function i(e,n){return r(e,n,"3","³")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixCubes=i,t.fixExponents=function(e,n){return e=i(e=s(e,n),n)},t.fixSquares=s},{}],10:[function(e,n,t){function r(e,n,t,r){return e.replace(new RegExp("([^0-9]|^)(["+r.spaces+"]*)(\\("+n+"\\)|"+t+")","gi"),"$1"+t)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMarks=function(e,n){return e=r(e,"r",n.registeredTrademark,n),e=r(e,"sm",n.serviceMark,n),e=r(e,"tm",n.trademark,n)},t.replaceMark=r},{}],11:[function(e,n,t){function r(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)(["+n.spaces+"][x]["+n.spaces+"])(["+n.cardinalNumber+"]+)(["+n.spaces+"]?["+n.lowercaseChars+n.singlePrime+n.doublePrime+"]*)",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e=(e=e.replace(t,n)).replace(t,n)}function s(e,n){var t="(["+n.allChars+"]+)(["+n.spaces+"][x]["+n.spaces+"])(["+n.allChars+"]+)",t=new RegExp(t,"g"),n="$1"+n.nbsp+n.multiplicationSign+n.nbsp+"$3";return e=(e=e.replace(t,n)).replace(t,n)}function i(e,a){var n="(["+a.cardinalNumber+"])(["+a.spaces+"]?)([x|×])(["+a.spaces+"])(["+a.lowercaseChars+"]+)",n=new RegExp(n,"gi");return e=e.replace(n,function(e,n,t,r,s,i){return""==t?n+t+a.multiplicationSign+a.nbsp+i:n+a.nbsp+a.multiplicationSign+a.nbsp+i})}function a(e,n){var t="(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?([x|×])(["+n.cardinalNumber+"]+)(["+n.singlePrime+n.doublePrime+"])?",t=new RegExp(t,"gi"),n="$1$2"+n.nbsp+n.multiplicationSign+n.nbsp+"$4$5";return e.replace(t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.fixMultiplicationSign=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)},t.fixMultiplicationSignBetweenNumberAndWord=i,t.fixMultiplicationSignBetweenNumbers=r,t.fixMultiplicationSignBetweenWords=s,t.fixNbspAroundMultiplicationSign=a},{}],12:[function(e,n,t){function r(e,n){return e.replace(new RegExp("(["+n.spaces+"]+)("+n.numberSign+")(["+n.spaces+"]+)("+n.cardinalNumber+")","g"),"$1$2$4")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixNumberSign=function(e,n){return e=r(e,n)},t.removeExtraSpacesAfterNumberSign=r},{}],13:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixPlusMinus=function(e,n){var t=new RegExp("(\\+\\-)|(\\-\\+)","g"),n=n.plusMinus;return e.replace(t,n)}},{}],14:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSectionSign=function(e,n){return e=((e,n)=>{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],15:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixSoundRecordingCopyright=function(e,n){return e=((e,n)=>{var t="(\\(p\\))(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"gi"),n=n.soundRecordingCopyright+"$2$3";return e.replace(t,n)})(e,n),e=(0,r.addSpaceBeforeSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.addNbspAfterSymbol)(e,n,n.soundRecordingCopyright),e=(0,s.replaceSpacesWithNbspAfterSymbol)(e,n,n.soundRecordingCopyright)};var r=e("../whitespace/spaces"),s=e("../whitespace/nbsp")},{"../whitespace/nbsp":17,"../whitespace/spaces":18}],16:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],17:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function i(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function a(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,a){var n="(\\b["+a.uppercaseChars+"]["+a.lowercaseChars+"]+?)(["+a.spaces+"])(["+a.romanNumerals+"]+\\b)("+a.romanOrdinalIndicator+")(["+a.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,i){return""==i&&"I"==r?n+a.space+r+s:""==i&&"I"!=r?n+a.nbsp+r+s:i==a.nbsp&&"I"==r?n+a.space+r+s+i:n+a.nbsp+r+s+a.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,a){var n=a.uppercaseChars;"en-us"==a.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+a.sentencePunctuation+a.ellipsis+a.closingBrackets+a.rightDoubleQuote+a.rightSingleQuote+a.apostrophe+a.multiplicationSign+a.emDash+a.enDash+"])(["+a.spaces+"])(["+n+"])((["+a.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,i){return"en-us"==a.locale||"I"!=r||i!=a.nbsp&&i!=a.hairSpace&&i!=a.narrowNbsp?n+a.nbsp+r+s:n+a.nbsp+r+a.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=i,t.addNbspAfterCardinalNumber=a,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=a(e=i(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],18:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),i=0;in.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],22:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function i(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function a(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=i,t.fixISBNnumber=a,t.fixISSN=r,t.fixPubId=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)}},{}],23:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],25:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],26:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),i=p(e("./en-us")),a=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":i.default,rue:a.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":23,"./de-de":24,"./en-us":25,"./rue":27,"./sk":28}],27:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],29:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new i.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,P.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,a.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyright)(e,n),e=(0,$.fixSoundRecordingCopyright)(e,n),e=(0,w.fixPlusMinus)(e,n),e=(0,y.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,_.fixNumberSign)(e,n),e=(0,S.fixCase)(e,n),e=(0,v.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,P.placeExceptions)(e,r)};var i=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},a=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyright"),$=e("./lib/symbols/sound-recording-copyright"),w=e("./lib/symbols/plus-minus"),y=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),_=e("./lib/symbols/number-sign"),v=e("./lib/words/abbreviations"),S=e("./lib/words/case"),E=e("./lib/words/pub-id"),P=e("./lib/words/exceptions")},{"./lib/punctuation/dash":1,"./lib/punctuation/double-quotes":2,"./lib/punctuation/ellipsis":3,"./lib/punctuation/hyphen":4,"./lib/punctuation/period":6,"./lib/punctuation/single-quotes":7,"./lib/symbols/copyright":8,"./lib/symbols/exponents":9,"./lib/symbols/marks":10,"./lib/symbols/multiplication-sign":11,"./lib/symbols/number-sign":12,"./lib/symbols/plus-minus":13,"./lib/symbols/section-sign":14,"./lib/symbols/sound-recording-copyright":15,"./lib/whitespace/lines":16,"./lib/whitespace/nbsp":17,"./lib/whitespace/spaces":18,"./lib/words/abbreviations":19,"./lib/words/case":20,"./lib/words/exceptions":21,"./lib/words/pub-id":22,"./locale/locale":26}]},{},[29])(29)}); \ No newline at end of file +!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).typopo=e()}(function(){return function r(s,i,a){function o(n,e){if(!i[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=i[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,i,a)}return i[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],15:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],16:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function i(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function a(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,a){var n="(\\b["+a.uppercaseChars+"]["+a.lowercaseChars+"]+?)(["+a.spaces+"])(["+a.romanNumerals+"]+\\b)("+a.romanOrdinalIndicator+")(["+a.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,i){return""==i&&"I"==r?n+a.space+r+s:""==i&&"I"!=r?n+a.nbsp+r+s:i==a.nbsp&&"I"==r?n+a.space+r+s+i:n+a.nbsp+r+s+a.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,a){var n=a.uppercaseChars;"en-us"==a.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+a.sentencePunctuation+a.ellipsis+a.closingBrackets+a.rightDoubleQuote+a.rightSingleQuote+a.apostrophe+a.multiplicationSign+a.emDash+a.enDash+"])(["+a.spaces+"])(["+n+"])((["+a.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,i){return"en-us"==a.locale||"I"!=r||i!=a.nbsp&&i!=a.hairSpace&&i!=a.narrowNbsp?n+a.nbsp+r+s:n+a.nbsp+r+a.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=i,t.addNbspAfterCardinalNumber=a,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=a(e=i(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],17:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),i=0;in.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],21:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function i(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function a(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=i,t.fixISBNnumber=a,t.fixISSN=r,t.fixPubId=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)}},{}],22:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],23:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],25:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),i=p(e("./en-us")),a=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":i.default,rue:a.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":22,"./de-de":23,"./en-us":24,"./rue":26,"./sk":27}],26:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],27:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new i.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,S.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,a.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyrights)(e,n),e=(0,$.fixPlusMinus)(e,n),e=(0,w.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,y.fixNumberSign)(e,n),e=(0,v.fixCase)(e,n),e=(0,_.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,S.placeExceptions)(e,r)};var i=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},a=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyrights"),$=e("./lib/symbols/plus-minus"),w=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),y=e("./lib/symbols/number-sign"),_=e("./lib/words/abbreviations"),v=e("./lib/words/case"),E=e("./lib/words/pub-id"),S=e("./lib/words/exceptions")},{"./lib/punctuation/dash":1,"./lib/punctuation/double-quotes":2,"./lib/punctuation/ellipsis":3,"./lib/punctuation/hyphen":4,"./lib/punctuation/period":6,"./lib/punctuation/single-quotes":7,"./lib/symbols/copyrights":8,"./lib/symbols/exponents":9,"./lib/symbols/marks":10,"./lib/symbols/multiplication-sign":11,"./lib/symbols/number-sign":12,"./lib/symbols/plus-minus":13,"./lib/symbols/section-sign":14,"./lib/whitespace/lines":15,"./lib/whitespace/nbsp":16,"./lib/whitespace/spaces":17,"./lib/words/abbreviations":18,"./lib/words/case":19,"./lib/words/exceptions":20,"./lib/words/pub-id":21,"./locale/locale":25}]},{},[28])(28)}); \ No newline at end of file diff --git a/src/lib/symbols/copyright.js b/src/lib/symbols/copyright.js deleted file mode 100644 index 8bb5cf1..0000000 --- a/src/lib/symbols/copyright.js +++ /dev/null @@ -1,22 +0,0 @@ -import {addSpaceBeforeSymbol} from "../whitespace/spaces"; -import {addNbspAfterSymbol, - replaceSpacesWithNbspAfterSymbol} from "../whitespace/nbsp"; - -function replaceCwithCopyright(string, locale) { - let pattern = "(\\(c\\))([" + locale.spaces + "]?)(" + locale.cardinalNumber + ")"; - let re = new RegExp(pattern, "gi"); - let replacement = locale.copyright + "$2$3"; - - return string.replace(re, replacement); -} - - - -export function fixCopyright(string, locale) { - string = replaceCwithCopyright(string, locale); - string = addSpaceBeforeSymbol(string, locale, locale.copyright); - string = addNbspAfterSymbol(string, locale, locale.copyright); - string = replaceSpacesWithNbspAfterSymbol(string, locale, locale.copyright); - - return string -} diff --git a/src/lib/symbols/copyrights.js b/src/lib/symbols/copyrights.js new file mode 100644 index 0000000..62d410d --- /dev/null +++ b/src/lib/symbols/copyrights.js @@ -0,0 +1,60 @@ +import {addSpaceBeforeSymbol} from "../whitespace/spaces"; +import {addNbspAfterSymbol, + replaceSpacesWithNbspAfterSymbol} from "../whitespace/nbsp"; + + +/** + * Replaces occurrences of a copyright indication in a string followed by a year. + * + * Example: Company (c) 2017 -> Company © 2017 + * + * @param {string} string - The input string where marks will be replaced. + * @param {string} copyrightLetter - The pattern for the copyright (e.g., “p” for sound recording copyright). + * @param {string} copyrightSign - The symbol to replace the pattern with (e.g., “©” for copyright). + * @param {Object} locale - An object w/ locale-specific symbols. + * @returns {string} - The string with the specified copyrights replaced. + */ +export function replaceCopyright(string, copyrightLetter, copyrightSign, locale) { + return string.replace( + new RegExp( + "(\\(" + copyrightLetter + "\\))" + + "([" + locale.spaces + "]*)" + + "(" + locale.cardinalNumber + ")", + "gi" + ), + copyrightSign + "$2$3" + ); +} + + + +/** + * Consolidates spaces around copyright sign + * + * @param {string} string - The input string where marks will be replaced. + * @param {string} copyrightSign - The sign of choice, either © or ℗ + * @param {Object} locale - An object w/ locale-specific symbols. + * @returns {string} - The string with the consolidated spaces around the copyright sign + */ +export function consolidateSpaces(string, copyrightSign, locale) { + string = addSpaceBeforeSymbol(string, locale, copyrightSign); + string = addNbspAfterSymbol(string, locale, copyrightSign); + string = replaceSpacesWithNbspAfterSymbol(string, locale, copyrightSign); + return string; +} + + +/** + * Fixes occurrences of copyright (©), and sound recording copyright (℗) in a given string. + * + * @param {string} string - The input string to be fixed. + * @param {Object} locale - An object w/ locale-specific symbols + * @returns {string} - The string with marks replaced. + */ +export function fixCopyrights(string, locale) { + string = replaceCopyright(string, "c", locale.copyright, locale); + string = consolidateSpaces(string, locale.copyright, locale); + string = replaceCopyright(string, "p", locale.soundRecordingCopyright, locale); + string = consolidateSpaces(string, locale.soundRecordingCopyright, locale); + return string; +} diff --git a/src/lib/symbols/marks.js b/src/lib/symbols/marks.js index 4d7889a..8be2468 100644 --- a/src/lib/symbols/marks.js +++ b/src/lib/symbols/marks.js @@ -1,16 +1,14 @@ - /** * Replaces occurrences of a specific mark in a string. * * Example: Company (tm) -> Company™ * * @param {string} string - The input string where marks will be replaced. - * @param {Object} locale - An object w/ locale-specific symbols. * @param {string} markPattern - The pattern for the mark (e.g., “tm” for trademark). * @param {string} replacementMark - The symbol to replace the pattern with (e.g., “™” for trademark). + * @param {Object} locale - An object w/ locale-specific symbols. * @returns {string} - The string with the specified marks replaced. */ - export function replaceMark(string, markPattern, replacementMark, locale) { return string.replace( new RegExp( @@ -32,7 +30,6 @@ export function replaceMark(string, markPattern, replacementMark, locale) { * @param {Object} locale - An object w/ locale-specific symbols * @returns {string} - The string with marks replaced. */ - export function fixMarks(string, locale) { string = replaceMark(string, "r", locale.registeredTrademark, locale); diff --git a/src/lib/symbols/sound-recording-copyright.js b/src/lib/symbols/sound-recording-copyright.js deleted file mode 100644 index c7e6495..0000000 --- a/src/lib/symbols/sound-recording-copyright.js +++ /dev/null @@ -1,23 +0,0 @@ -import {addSpaceBeforeSymbol} from "../whitespace/spaces"; -import {addNbspAfterSymbol, - replaceSpacesWithNbspAfterSymbol} from "../whitespace/nbsp"; - - -function replaceCwithCopyright(string, locale) { - let pattern = "(\\(p\\))([" + locale.spaces + "]?)(" + locale.cardinalNumber + ")"; - let re = new RegExp(pattern, "gi"); - let replacement = locale.soundRecordingCopyright + "$2$3"; - - return string.replace(re, replacement); -} - - - -export function fixSoundRecordingCopyright(string, locale) { - string = replaceCwithCopyright(string, locale); - string = addSpaceBeforeSymbol(string, locale, locale.soundRecordingCopyright); - string = addNbspAfterSymbol(string, locale, locale.soundRecordingCopyright); - string = replaceSpacesWithNbspAfterSymbol(string, locale, locale.soundRecordingCopyright); - - return string -} diff --git a/src/test/integration/typopo.test.js b/src/test/integration/typopo.test.js index 8ef54c6..bd432c4 100644 --- a/src/test/integration/typopo.test.js +++ b/src/test/integration/typopo.test.js @@ -95,12 +95,29 @@ let testModules = { "under Law §1782": "under Law § 1782", // copyright "Company (c)2017": "Company © 2017", + "( c ) 2017": "© 2017", + "( c ) 2017": "© 2017", + "( c )2017": "© 2017", + "Company (c) 2017": "Company © 2017", + "Company (c) 2017": "Company © 2017", + "Company (c) 2017": "Company © 2017", + "Company (c) 2017": "Company © 2017", + "Company © 2017": "Company © 2017", + // exponents "100 km3": "100 km³", // plus-minus "+-": "±", // sound recording copyright "Company (p)2017": "Company ℗ 2017", + "( p ) 2017": "℗ 2017", + "( p ) 2017": "℗ 2017", + "( p )2017": "℗ 2017", + "Company (p) 2017": "Company ℗ 2017", + "Company (p) 2017": "Company ℗ 2017", + "Company (p) 2017": "Company ℗ 2017", + "Company (p) 2017": "Company ℗ 2017", + "Company ℗ 2017": "Company ℗ 2017", //registered trademark "Company (r)": "Company®", "Company ( r )": "Company®", diff --git a/src/test/symbols/copyright.test.js b/src/test/symbols/copyright.test.js deleted file mode 100644 index fb9ddc5..0000000 --- a/src/test/symbols/copyright.test.js +++ /dev/null @@ -1,38 +0,0 @@ -import { fixCopyright } from "../../lib/symbols/copyright"; -import { fixTypos } from "../../typopo"; -import assert from 'assert'; -import Locale from "../../locale/locale"; - -describe('Fix copyright ©\n', () => { - let testCase = { - "(c)2017": "© 2017", - "Company (c)2017": "Company © 2017", - "Company (C)2017": "Company © 2017", - "Company ©2017": "Company © 2017", - "Company © 2017": "Company © 2017", - "Company(c) 2017": "Company © 2017", - "Company(C) 2017": "Company © 2017", - "Company© 2017": "Company © 2017", - "Sec­tion 7(c)": "Sec­tion 7(c)", - }; - - Object.keys(testCase).forEach((key) => { - it("unit test", () => { - assert.strictEqual(fixCopyright(key, new Locale("en-us")), testCase[key]); - }); - }); -}); - -describe('Fix copyright ©\n', () => { - let testCase = { - "( c ) 2017": "© 2017", - "( c ) 2017": "© 2017", - "( c )2017": "© 2017", - }; - - Object.keys(testCase).forEach((key) => { - it("integration test", () => { - assert.strictEqual(fixTypos(key, "en-us"), testCase[key]); - }); - }); -}); diff --git a/src/test/symbols/copyrights.test.js b/src/test/symbols/copyrights.test.js new file mode 100644 index 0000000..874b948 --- /dev/null +++ b/src/test/symbols/copyrights.test.js @@ -0,0 +1,65 @@ +import { fixCopyrights } from "../../lib/symbols/copyrights"; +import assert from 'assert'; +import Locale from "../../locale/locale"; + +const locales = ["en-us", "de-de", "sk", "cs", "rue"]; + +const copyright = { + "(c)2017": "© 2017", + "(C)2017": "© 2017", + "Company (c)2017": "Company © 2017", + "Company (C)2017": "Company © 2017", + "Company(c) 2017": "Company © 2017", + "Company(C) 2017": "Company © 2017", + "Company (c) 2017": "Company © 2017", + "Company (C) 2017": "Company © 2017", + //multiple spaces around (c) are already sanitizaed, when fixCopyrights() is being called + "Company© 2017": "Company © 2017", + "Company © 2017": "Company © 2017", + "Company ©2017": "Company © 2017", + "Sec­tion 7(c)": "Sec­tion 7(c)", // false positive +}; + +const soundRecordingCopyright = { + "(p)2017": "℗ 2017", + "(P)2017": "℗ 2017", + "Company (p)2017": "Company ℗ 2017", + "Company (P)2017": "Company ℗ 2017", + "Company(p) 2017": "Company ℗ 2017", + "Company(P) 2017": "Company ℗ 2017", + "Company (p) 2017": "Company ℗ 2017", + "Company (P) 2017": "Company ℗ 2017", + //multiple spaces around (p) are already sanitizaed, when fixCopyrights() is being called + "Company℗ 2017": "Company ℗ 2017", + "Company ℗ 2017": "Company ℗ 2017", + "Company ℗2017": "Company ℗ 2017", + "Sec­tion 7(p)": "Sec­tion 7(p)", // false positive +}; + + + +function testCopyrights(testCase, copyrightSign) { + locales.forEach(function(locale) { + Object.keys(testCase).forEach((key) => { + it(`module test, ${copyrightSign}, ${locale}`, () => { + assert.strictEqual( + fixCopyrights( + key, + new Locale(locale)), + testCase[key] + ); + }); + }); + }); +} + +describe('Fix copyright (©):\n', () => { + testCopyrights(copyright, "©"); +}); + +describe('Fix sound recording copyright (℗):\n', () => { + testCopyrights(soundRecordingCopyright, "℗"); +}); + + + diff --git a/src/test/symbols/marks.test.js b/src/test/symbols/marks.test.js index 57460da..d306c3d 100644 --- a/src/test/symbols/marks.test.js +++ b/src/test/symbols/marks.test.js @@ -72,7 +72,6 @@ function testMarks(testCase, markPattern, replacementMark) { }); }); }); - } diff --git a/src/test/symbols/sound-recording-copyright.test.js b/src/test/symbols/sound-recording-copyright.test.js deleted file mode 100644 index 5c2e0b7..0000000 --- a/src/test/symbols/sound-recording-copyright.test.js +++ /dev/null @@ -1,23 +0,0 @@ -import {fixSoundRecordingCopyright} from "../../lib/symbols/sound-recording-copyright"; -import assert from 'assert'; -import Locale from "../../locale/locale"; - -describe('Fix copyright ©\n', () => { - let testCase = { - "(p)2017": "℗ 2017", - "Company (p)2017": "Company ℗ 2017", - "Company (P)2017": "Company ℗ 2017", - "Company ℗2017": "Company ℗ 2017", - "Company ℗ 2017": "Company ℗ 2017", - "Company(p) 2017": "Company ℗ 2017", - "Company(P) 2017": "Company ℗ 2017", - "Company℗ 2017": "Company ℗ 2017", - "Sec­tion 7(p)": "Sec­tion 7(p)", - }; - - Object.keys(testCase).forEach((key) => { - it("", () => { - assert.strictEqual(fixSoundRecordingCopyright(key, new Locale("en-us")), testCase[key]); - }); - }); -}); diff --git a/src/typopo.js b/src/typopo.js index ed4ec6d..4804003 100644 --- a/src/typopo.js +++ b/src/typopo.js @@ -15,8 +15,7 @@ import {fixDoubleQuotesAndPrimes} from "./lib/punctuation/double-quotes"; import {fixSingleQuotesPrimesAndApostrophes} from "./lib/punctuation/single-quotes"; import {fixMultiplicationSign} from "./lib/symbols/multiplication-sign"; import {fixSectionSign} from "./lib/symbols/section-sign"; -import {fixCopyright} from "./lib/symbols/copyright"; -import {fixSoundRecordingCopyright} from "./lib/symbols/sound-recording-copyright"; +import {fixCopyrights} from "./lib/symbols/copyrights"; import {fixPlusMinus} from "./lib/symbols/plus-minus"; import {fixMarks} from "./lib/symbols/marks"; import {fixExponents} from "./lib/symbols/exponents"; @@ -72,8 +71,7 @@ export function fixTypos(string, locale, configuration) { // symbols string = fixMultiplicationSign(string, currentLocale); string = fixSectionSign(string, currentLocale); - string = fixCopyright(string, currentLocale); - string = fixSoundRecordingCopyright(string, currentLocale); + string = fixCopyrights(string, currentLocale); string = fixPlusMinus(string, currentLocale); string = fixMarks(string, currentLocale); string = fixExponents(string, currentLocale); From f118f9e0c10ce44ab44f1fb43b0f24102bc15bd1 Mon Sep 17 00:00:00 2001 From: Brano Sandala Date: Sun, 22 Sep 2024 14:26:47 +0200 Subject: [PATCH 3/5] Swap params order --- dist/typopo.min.js | 2 +- dist/typopo_dist.min.js | 2 +- src/lib/symbols/copyrights.js | 6 +++--- src/lib/whitespace/nbsp.js | 4 ++-- src/lib/whitespace/spaces.js | 2 +- src/test/whitespace/nbsp.test.js | 4 ++-- src/test/whitespace/spaces.test.js | 9 +++++++-- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/dist/typopo.min.js b/dist/typopo.min.js index e58d959..557f915 100644 --- a/dist/typopo.min.js +++ b/dist/typopo.min.js @@ -3,4 +3,4 @@ * Copyright 2015–2024 Braňo Šandala (https://brano.me) * Licensed under MIT (https://github.com/surfinzap/typopo/blob/main/LICENSE.txt) */ -!function r(s,a,i){function o(n,e){if(!a[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=a[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,a,i)}return a[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],16:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],17:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function a(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function i(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,i){var n="(\\b["+i.uppercaseChars+"]["+i.lowercaseChars+"]+?)(["+i.spaces+"])(["+i.romanNumerals+"]+\\b)("+i.romanOrdinalIndicator+")(["+i.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,a){return""==a&&"I"==r?n+i.space+r+s:""==a&&"I"!=r?n+i.nbsp+r+s:a==i.nbsp&&"I"==r?n+i.space+r+s+a:n+i.nbsp+r+s+i.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,i){var n=i.uppercaseChars;"en-us"==i.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+i.sentencePunctuation+i.ellipsis+i.closingBrackets+i.rightDoubleQuote+i.rightSingleQuote+i.apostrophe+i.multiplicationSign+i.emDash+i.enDash+"])(["+i.spaces+"])(["+n+"])((["+i.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,a){return"en-us"==i.locale||"I"!=r||a!=i.nbsp&&a!=i.hairSpace&&a!=i.narrowNbsp?n+i.nbsp+r+s:n+i.nbsp+r+i.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=a,t.addNbspAfterCardinalNumber=i,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=i(e=a(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],18:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),a=0;an.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],22:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function a(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function i(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=a,t.fixISBNnumber=i,t.fixISSN=r,t.fixPubId=function(e,n){return e=i(e=a(e=s(e=r(e,n),n),n),n)}},{}],23:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],25:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],26:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),a=p(e("./en-us")),i=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":a.default,rue:i.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":23,"./de-de":24,"./en-us":25,"./rue":27,"./sk":28}],27:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],29:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new a.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,S.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,i.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyrights)(e,n),e=(0,$.fixPlusMinus)(e,n),e=(0,w.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,y.fixNumberSign)(e,n),e=(0,v.fixCase)(e,n),e=(0,_.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,S.placeExceptions)(e,r)};var a=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},i=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyrights"),$=e("./lib/symbols/plus-minus"),w=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),y=e("./lib/symbols/number-sign"),_=e("./lib/words/abbreviations"),v=e("./lib/words/case"),E=e("./lib/words/pub-id"),S=e("./lib/words/exceptions")},{"./lib/punctuation/dash":2,"./lib/punctuation/double-quotes":3,"./lib/punctuation/ellipsis":4,"./lib/punctuation/hyphen":5,"./lib/punctuation/period":7,"./lib/punctuation/single-quotes":8,"./lib/symbols/copyrights":9,"./lib/symbols/exponents":10,"./lib/symbols/marks":11,"./lib/symbols/multiplication-sign":12,"./lib/symbols/number-sign":13,"./lib/symbols/plus-minus":14,"./lib/symbols/section-sign":15,"./lib/whitespace/lines":16,"./lib/whitespace/nbsp":17,"./lib/whitespace/spaces":18,"./lib/words/abbreviations":19,"./lib/words/case":20,"./lib/words/exceptions":21,"./lib/words/pub-id":22,"./locale/locale":26}]},{},[1]); \ No newline at end of file +!function r(s,a,i){function o(n,e){if(!a[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=a[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,a,i)}return a[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],16:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],17:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function a(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function i(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,i){var n="(\\b["+i.uppercaseChars+"]["+i.lowercaseChars+"]+?)(["+i.spaces+"])(["+i.romanNumerals+"]+\\b)("+i.romanOrdinalIndicator+")(["+i.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,a){return""==a&&"I"==r?n+i.space+r+s:""==a&&"I"!=r?n+i.nbsp+r+s:a==i.nbsp&&"I"==r?n+i.space+r+s+a:n+i.nbsp+r+s+i.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,i){var n=i.uppercaseChars;"en-us"==i.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+i.sentencePunctuation+i.ellipsis+i.closingBrackets+i.rightDoubleQuote+i.rightSingleQuote+i.apostrophe+i.multiplicationSign+i.emDash+i.enDash+"])(["+i.spaces+"])(["+n+"])((["+i.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,a){return"en-us"==i.locale||"I"!=r||a!=i.nbsp&&a!=i.hairSpace&&a!=i.narrowNbsp?n+i.nbsp+r+s:n+i.nbsp+r+i.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=a,t.addNbspAfterCardinalNumber=i,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){n="("+n+")([^"+t.spaces+"])",n=new RegExp(n,"g"),t="$1"+t.nbsp+"$2";return e.replace(n,t)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=i(e=a(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){n="("+n+")(["+t.spaces+"])",n=new RegExp(n,"g"),t="$1"+t.nbsp;return e.replace(n,t)}},{}],18:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),a=0;an.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],22:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function a(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function i(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=a,t.fixISBNnumber=i,t.fixISSN=r,t.fixPubId=function(e,n){return e=i(e=a(e=s(e=r(e,n),n),n),n)}},{}],23:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],25:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],26:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),a=p(e("./en-us")),i=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":a.default,rue:i.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":23,"./de-de":24,"./en-us":25,"./rue":27,"./sk":28}],27:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],29:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new a.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,S.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,i.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyrights)(e,n),e=(0,$.fixPlusMinus)(e,n),e=(0,w.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,y.fixNumberSign)(e,n),e=(0,v.fixCase)(e,n),e=(0,_.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,S.placeExceptions)(e,r)};var a=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},i=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyrights"),$=e("./lib/symbols/plus-minus"),w=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),y=e("./lib/symbols/number-sign"),_=e("./lib/words/abbreviations"),v=e("./lib/words/case"),E=e("./lib/words/pub-id"),S=e("./lib/words/exceptions")},{"./lib/punctuation/dash":2,"./lib/punctuation/double-quotes":3,"./lib/punctuation/ellipsis":4,"./lib/punctuation/hyphen":5,"./lib/punctuation/period":7,"./lib/punctuation/single-quotes":8,"./lib/symbols/copyrights":9,"./lib/symbols/exponents":10,"./lib/symbols/marks":11,"./lib/symbols/multiplication-sign":12,"./lib/symbols/number-sign":13,"./lib/symbols/plus-minus":14,"./lib/symbols/section-sign":15,"./lib/whitespace/lines":16,"./lib/whitespace/nbsp":17,"./lib/whitespace/spaces":18,"./lib/words/abbreviations":19,"./lib/words/case":20,"./lib/words/exceptions":21,"./lib/words/pub-id":22,"./locale/locale":26}]},{},[1]); \ No newline at end of file diff --git a/dist/typopo_dist.min.js b/dist/typopo_dist.min.js index b2714ca..a8f85ef 100644 --- a/dist/typopo_dist.min.js +++ b/dist/typopo_dist.min.js @@ -3,4 +3,4 @@ * Copyright 2015–2024 Braňo Šandala (https://brano.me) * Licensed under MIT (https://github.com/surfinzap/typopo/blob/main/LICENSE.txt) */ -!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).typopo=e()}(function(){return function r(s,i,a){function o(n,e){if(!i[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=i[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,i,a)}return i[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],15:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],16:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function i(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function a(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,a){var n="(\\b["+a.uppercaseChars+"]["+a.lowercaseChars+"]+?)(["+a.spaces+"])(["+a.romanNumerals+"]+\\b)("+a.romanOrdinalIndicator+")(["+a.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,i){return""==i&&"I"==r?n+a.space+r+s:""==i&&"I"!=r?n+a.nbsp+r+s:i==a.nbsp&&"I"==r?n+a.space+r+s+i:n+a.nbsp+r+s+a.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,a){var n=a.uppercaseChars;"en-us"==a.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+a.sentencePunctuation+a.ellipsis+a.closingBrackets+a.rightDoubleQuote+a.rightSingleQuote+a.apostrophe+a.multiplicationSign+a.emDash+a.enDash+"])(["+a.spaces+"])(["+n+"])((["+a.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,i){return"en-us"==a.locale||"I"!=r||i!=a.nbsp&&i!=a.hairSpace&&i!=a.narrowNbsp?n+a.nbsp+r+s:n+a.nbsp+r+a.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=i,t.addNbspAfterCardinalNumber=a,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){t="("+t+")([^"+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=a(e=i(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){t="("+t+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)}},{}],17:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),i=0;in.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],21:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function i(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function a(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=i,t.fixISBNnumber=a,t.fixISSN=r,t.fixPubId=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)}},{}],22:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],23:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],25:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),i=p(e("./en-us")),a=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":i.default,rue:a.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":22,"./de-de":23,"./en-us":24,"./rue":26,"./sk":27}],26:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],27:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new i.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,S.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,a.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyrights)(e,n),e=(0,$.fixPlusMinus)(e,n),e=(0,w.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,y.fixNumberSign)(e,n),e=(0,v.fixCase)(e,n),e=(0,_.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,S.placeExceptions)(e,r)};var i=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},a=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyrights"),$=e("./lib/symbols/plus-minus"),w=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),y=e("./lib/symbols/number-sign"),_=e("./lib/words/abbreviations"),v=e("./lib/words/case"),E=e("./lib/words/pub-id"),S=e("./lib/words/exceptions")},{"./lib/punctuation/dash":1,"./lib/punctuation/double-quotes":2,"./lib/punctuation/ellipsis":3,"./lib/punctuation/hyphen":4,"./lib/punctuation/period":6,"./lib/punctuation/single-quotes":7,"./lib/symbols/copyrights":8,"./lib/symbols/exponents":9,"./lib/symbols/marks":10,"./lib/symbols/multiplication-sign":11,"./lib/symbols/number-sign":12,"./lib/symbols/plus-minus":13,"./lib/symbols/section-sign":14,"./lib/whitespace/lines":15,"./lib/whitespace/nbsp":16,"./lib/whitespace/spaces":17,"./lib/words/abbreviations":18,"./lib/words/case":19,"./lib/words/exceptions":20,"./lib/words/pub-id":21,"./locale/locale":25}]},{},[28])(28)}); \ No newline at end of file +!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).typopo=e()}(function(){return function r(s,i,a){function o(n,e){if(!i[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(p)return p(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=i[n]={exports:{}},s[n][0].call(t.exports,function(e){return o(s[n][1][e]||e)},t,t.exports,r,s,i,a)}return i[n].exports}for(var p="function"==typeof require&&require,e=0;e{var t="("+n.sectionSign+")(["+n.spaces+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp;return e.replace(t,n)})(e=((e,n)=>{var t="("+n.sectionSign+")([^"+n.spaces+n.sectionSign+"])",t=new RegExp(t,"g"),n="$1"+n.nbsp+"$2";return e.replace(t,n)})(e=((e,n)=>{var t="([^"+n.spaces+n.sectionSign+n.openingBrackets+"])("+n.sectionSign+")",t=new RegExp(t,"g"),n="$1"+n.space+"$2";return e.replace(t,n)})(e,n),n),n)}},{}],15:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyLines=function(e){return e.replace(/[\n\r]{2,}/gm,"\n")}},{}],16:[function(e,n,t){function r(e,n){n="(["+n.lowercaseChars+n.uppercaseChars+"]{2,})(["+n.nbsp+n.narrowNbsp+"])(["+n.lowercaseChars+n.uppercaseChars+"]{2,})",n=new RegExp(n,"g");return e=(e=e.replace(n,"$1 $3")).replace(n,"$1 $3")}function s(e,n){var t="(^|["+n.space+"]|[^"+n.allChars+n.cardinalNumber+n.apostrophe+n.plus+n.minus+n.hyphen+"])(["+n.lowercaseChars+"])(["+n.space+"])",r=new RegExp(t,"g"),s="$1$2"+n.nbsp;return e=(e=e.replace(r,s)).replace(r,s),t="(^|["+n.sentencePunctuation+n.ellipsis+n.copyright+n.registeredTrademark+n.soundRecordingCopyright+"])(["+n.spaces+"]?)(["+n.uppercaseChars+"])(["+n.spaces+"])",r=new RegExp(t,"g"),s="$1$2$3"+n.nbsp,e=e.replace(r,s),e="en-us"==n.locale?e.replace(new RegExp("(^|["+n.spaces+"])(I)(["+n.spaces+"])","g"),"$1$2"+n.nbsp):e}function i(e,n){var t="(["+n.spaces+"])("+n.ampersand+")(["+n.spaces+"])",t=new RegExp(t,"g"),n=" $2"+n.nbsp;return e.replace(t,n)}function a(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"]|^)("+n.cardinalNumber+"{1,2})(["+n.spaces+"])(["+n.allChars+"])","g"),"$1$2"+n.nbsp+"$4")}function o(e,n){return e.replace(new RegExp("([^"+n.nbsp+n.cardinalNumber+"_%\\-]|^)("+n.cardinalNumber+"{1,2})("+n.ordinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+"])","g"),"$1$2$3"+n.nbsp+"$5")}function p(e,n){var t="("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")("+n.ordinalIndicator+")(["+n.spaces+"]?)("+n.cardinalNumber+")",t=new RegExp(t,"g"),r="";switch(n.locale){case"en-us":case"rue":case"sk":case"cs":r="$1$2"+n.nbsp+"$4$5"+n.nbsp+"$7";break;case"de-de":r="$1$2"+n.nbsp+"$4$5"+n.space+"$7"}return e.replace(t,r)}function l(e,n){var t;return""!=n.romanOrdinalIndicator?(t="(\\b)(["+n.romanNumerals+"]+)("+n.romanOrdinalIndicator+")(["+n.spaces+"]?)(["+n.allChars+n.cardinalNumber+"])",t=new RegExp(t,"g"),n="$1$2$3"+n.nbsp+"$5",e.replace(t,n)):e}function u(e,a){var n="(\\b["+a.uppercaseChars+"]["+a.lowercaseChars+"]+?)(["+a.spaces+"])(["+a.romanNumerals+"]+\\b)("+a.romanOrdinalIndicator+")(["+a.nbsp+"]?)",n=new RegExp(n,"g");return e.replace(n,function(e,n,t,r,s,i){return""==i&&"I"==r?n+a.space+r+s:""==i&&"I"!=r?n+a.nbsp+r+s:i==a.nbsp&&"I"==r?n+a.space+r+s+i:n+a.nbsp+r+s+a.space})}function c(e,n){var t="(["+n.spaces+"])(["+n.percent+n.permille+n.permyriad+"])",t=new RegExp(t,"g"),n=n.nbsp+"$2";return e.replace(t,n)}function d(e,a){var n=a.uppercaseChars;"en-us"==a.locale&&(n=n.replace(/A-Z/g,"A-HJ-Z"));n=new RegExp("([^"+a.sentencePunctuation+a.ellipsis+a.closingBrackets+a.rightDoubleQuote+a.rightSingleQuote+a.apostrophe+a.multiplicationSign+a.emDash+a.enDash+"])(["+a.spaces+"])(["+n+"])((["+a.spaces+"])|(\\.$|$))","g");return e.replace(n,function(e,n,t,r,s,i){return"en-us"==a.locale||"I"!=r||i!=a.nbsp&&i!=a.hairSpace&&i!=a.narrowNbsp?n+a.nbsp+r+s:n+a.nbsp+r+a.space})}Object.defineProperty(t,"__esModule",{value:!0}),t.addNbspAfterAmpersand=i,t.addNbspAfterCardinalNumber=a,t.addNbspAfterOrdinalNumber=o,t.addNbspAfterPreposition=s,t.addNbspAfterRomanNumeral=l,t.addNbspAfterSymbol=function(e,n,t){n="("+n+")([^"+t.spaces+"])",n=new RegExp(n,"g"),t="$1"+t.nbsp+"$2";return e.replace(n,t)},t.addNbspBeforePercent=c,t.addNbspBeforeSingleLetter=d,t.addNbspWithinOrdinalDate=p,t.fixNbsp=function(e,n){return e=c(e=u(e=d(e=l(e=p(e=o(e=a(e=i(e=s(e=r(e,n),n),n),n),n),n),n),n),n),n)},t.fixNbspForNameWithRegnalNumber=u,t.removeNbspBetweenMultiCharWords=r,t.replaceSpacesWithNbspAfterSymbol=function(e,n,t){n="("+n+")(["+t.spaces+"])",n=new RegExp(n,"g"),t="$1"+t.nbsp;return e.replace(n,t)}},{}],17:[function(e,n,t){function r(e,n){n="(\\S)(["+n.spaces+"]{2,})(\\S)",n=new RegExp(n,"g");return e.replace(n,"$1 $3")}function s(e,n,r){for(var t=e.split(/\r?\n/),s=new RegExp("(^\\s+)([-\\*\\+]*)","g"),i=0;in.reduce(function(e,n,t){t="{{typopo__exception-".concat(t,"}}");return e.replace(n,t)},e))(e,t),exceptions:t}},t.placeExceptions=function(e,n){return n.reduce(function(e,n,t){t=new RegExp("{{typopo__exception-".concat(t,"}}"),"g");return e.replace(t,n)},e)}},{}],21:[function(e,n,t){function r(e,n){var t="(issn)(:?)(["+n.spaces+"]?)(\\d{4})(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)(\\d{4})",t=new RegExp(t,"gi"),n="ISSN$2"+n.nbsp+"$4-$6";return e.replace(t,n)}function s(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10";return e.replace(t,n)}function i(e,n){var t="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",t=new RegExp("(isbn)(:?)(["+n.spaces+"]?)(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(\\d+)"+t+"(X|\\d+)","gi"),n="ISBN$2"+n.nbsp+"$4-$6-$8-$10-$12";return e.replace(t,n)}function a(e,n){n="(["+n.spaces+"]?["+n.hyphen+n.enDash+n.emDash+"]["+n.spaces+"]?)",n=new RegExp("(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(\\d+)"+n+"(X|\\d+?)","g");return e.replace(n,"$1-$3-$5-$7-$9")}Object.defineProperty(t,"__esModule",{value:!0}),t.fixISBN10=s,t.fixISBN13=i,t.fixISBNnumber=a,t.fixISSN=r,t.fixPubId=function(e,n){return e=a(e=i(e=s(e=r(e,n),n),n),n)}},{}],22:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","např","sv","tj","tzv"],multipleWordAbbreviations:["hl m","n l","p n l","př n l"]}},{}],23:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["S","z","St","Stk","Mo","Di","Mi","Do","Fr","Sa","So","Bhf","Hbf","Nr","ca","usw","geb","gest","u"],multipleWordAbbreviations:["b w","d h","d i","e V","n Chr","s a","s o","s u","u a","u ä","u Ä","u dgl","u U","u z","u zw","v a","v Chr","z B","z T","z Zt","n u Z","u a m","v u Z","Ges m b H"]}},{}],24:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"“",rightDoubleQuote:"”",leftSingleQuote:"‘",rightSingleQuote:"’"},numbers:{ordinalIndicator:"st|nd|rd|th",romanOrdinalIndicator:""},singleWordAbbreviations:["p","pp","no","vol"],multipleWordAbbreviations:["U S","e g","i e","a m","p m"]}},{}],25:[function(e,n,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(e("./cs")),i=p(e("./en-us")),a=p(e("./rue")),o=p(e("./sk")),e=p(e("./de-de"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,n){for(var t=0;t(e=((e,n)=>{if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=s(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==s(e)?e:e+""))(r.key),r)}}function u(e,n,t){return n&&l(e.prototype,n),t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var c={cs:r.default,"en-us":i.default,rue:a.default,sk:o.default,"de-de":e.default};t.default=u(function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(n in this.locale=n,this.nonLatinLowercase="áäčďéěíĺľňóôöőŕřšťúüűůýŷžабвгґдезіийклмнопрстуфъыьцчжшїщёєюях",this.nonLatinUppercase="ÁÄČĎÉĚÍĹĽŇÓÔÖŐŔŘŠŤÚÜŰŮÝŶŽАБВГҐДЕЗІИЙКЛМНОПРСТУФЪЫЬЦЧЖШЇЩЁЄЮЯХ",this.nonLatinChars=this.nonLatinLowercase+this.nonLatinUppercase,this.lowercaseChars="a-z"+this.nonLatinLowercase,this.uppercaseChars="A-Z"+this.nonLatinUppercase,this.allChars=this.lowercaseChars+this.uppercaseChars,this.singleQuoteAdepts="‚|'|‘|’|ʼ|‛|´|`|′|‹|›",this.leftSingleQuote=c[n].quotes.leftSingleQuote,this.rightSingleQuote=c[n].quotes.rightSingleQuote,this.apostrophe="’",this.singlePrime="′",this.backtick="`",this.doubleQuoteAdepts="„|“|”|\"|«|»|″|,{2,}|‘{2,}|’{2,}|'{2,}|‹{2,}|›{2,}|′{2,}|´{2,}|`{2,}",this.leftDoubleQuote=c[n].quotes.leftDoubleQuote,this.rightDoubleQuote=c[n].quotes.rightDoubleQuote,this.doublePrime="″",this.space=" ",this.nbsp=" ",this.hairSpace=" ",this.narrowNbsp=" ",this.spaces=this.space+this.nbsp+this.hairSpace+this.narrowNbsp,this.terminalPunctuation="\\.\\!\\?",this.terminalQuotes=this.rightSingleQuote+this.rightDoubleQuote,this.sentencePausePunctuation="\\,\\:\\;",this.sentencePunctuation=this.sentencePausePunctuation+this.terminalPunctuation,this.openingBrackets="\\(\\[\\{",this.closingBrackets="\\)\\]\\}",this.ellipsis="…",this.hyphen="-",this.enDash="–",this.emDash="—",this.slash="/",this.degree="°",this.multiplicationSign="×",this.ampersand="&",this.sectionSign="§",this.copyright="©",this.soundRecordingCopyright="℗",this.registeredTrademark="®",this.serviceMark="℠",this.trademark="™",this.plus="+",this.minus="−",this.plusMinus="±",this.percent="%",this.permille="‰",this.permyriad="‱",this.numberSign="#",this.urlPattern="((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|agency|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|cloud|com|company|coop|c[acdfghiklmnoruvxyz])|(?:dev|d[ejkmoz])|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|guide|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om|one)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|(?:shop|store|s[abcdeghijklmnortuvyz])|(?:tel|travel|team|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|(?:work|w[fs])|(?:xyz)|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)",this.emailPattern="[a-zA-Z0-9\\+\\.\\_\\%\\-]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+",this.filenamePattern="\\b[a-zA-Z0-9_%\\-]+\\.(ai|asm|bat|bmp|c|cpp|cs|css|csv|dart|doc|docx|exe|gif|go|html|ics|java|jpeg|jpg|js|json|key|kt|less|lua|log|md|mp4|odp|ods|odt|pdf|php|pl|png|ppt|pptx|psd|py|r|rar|rb|rs|scala|scss|sh|svg|sql|swift|tar.gz|tar|tex|tiff|ts|txt|vbs|xml|xls|xlsx|yaml|yml|zip)\\b",this.cardinalNumber="\\d",this.ordinalIndicator=c[n].numbers.ordinalIndicator,this.romanNumerals="IVXLCDM",this.romanOrdinalIndicator=c[n].numbers.romanOrdinalIndicator,this.singleWordAbbreviations=[],c)this.singleWordAbbreviations=this.singleWordAbbreviations.concat(c[n].singleWordAbbreviations);for(n in this.multipleWordAbbreviations=[],c)this.multipleWordAbbreviations=this.multipleWordAbbreviations.concat(c[n].multipleWordAbbreviations)})},{"./cs":22,"./de-de":23,"./en-us":24,"./rue":26,"./sk":27}],26:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"«",rightDoubleQuote:"»",leftSingleQuote:"‹",rightSingleQuote:"›"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["ціт","ст","канц","абз","тзв","Зб","ч","напр"],multipleWordAbbreviations:["т зн","Е Ч","евід ч","род ч","т ч","т д"]}},{}],27:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={quotes:{leftDoubleQuote:"„",rightDoubleQuote:"“",leftSingleQuote:"‚",rightSingleQuote:"‘"},numbers:{ordinalIndicator:"\\.",romanOrdinalIndicator:"\\."},singleWordAbbreviations:["č","s","fol","str","r","par","odst","napr","sv","tzv","čl","cit","roč","vyd"],multipleWordAbbreviations:["hl m","n l","p n l","pr n l","s a","s l","t j","zodp red","t č"]}},{}],28:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixTypos=function(e,n,t){n=void 0===n?"en-us":n;var n=new i.default(n),r=(t=void 0===t?{removeLines:!0,removeWhitespacesBeforeMarkdownList:!0,keepMarkdownCodeBlocks:!1}:t,(0,S.excludeExceptions)(e,n)),s=r.processedText,r=r.exceptions;e=s,t.removeLines&&(e=(0,a.removeEmptyLines)(e));return e=(0,u.fixEllipsis)(e,n),e=(0,p.fixSpaces)(e,n,t),e=(0,l.fixPeriod)(e),e=(0,d.fixDash)(e,n),e=(0,c.fixHyphen)(e,n),e=(0,f.fixSingleQuotesPrimesAndApostrophes)(e,n,t),e=(0,g.fixDoubleQuotesAndPrimes)(e,n,t),e=(0,h.fixMultiplicationSign)(e,n),e=(0,b.fixSectionSign)(e,n),e=(0,m.fixCopyrights)(e,n),e=(0,$.fixPlusMinus)(e,n),e=(0,w.fixMarks)(e,n),e=(0,x.fixExponents)(e,n),e=(0,y.fixNumberSign)(e,n),e=(0,v.fixCase)(e,n),e=(0,_.fixAbbreviations)(e,n),e=(0,E.fixPubId)(e,n),e=(0,o.fixNbsp)(e,n),e=(0,S.placeExceptions)(e,r)};var i=(t=e("./locale/locale"))&&t.__esModule?t:{default:t},a=e("./lib/whitespace/lines"),o=e("./lib/whitespace/nbsp"),p=e("./lib/whitespace/spaces"),l=e("./lib/punctuation/period"),u=e("./lib/punctuation/ellipsis"),c=e("./lib/punctuation/hyphen"),d=e("./lib/punctuation/dash"),g=e("./lib/punctuation/double-quotes"),f=e("./lib/punctuation/single-quotes"),h=e("./lib/symbols/multiplication-sign"),b=e("./lib/symbols/section-sign"),m=e("./lib/symbols/copyrights"),$=e("./lib/symbols/plus-minus"),w=e("./lib/symbols/marks"),x=e("./lib/symbols/exponents"),y=e("./lib/symbols/number-sign"),_=e("./lib/words/abbreviations"),v=e("./lib/words/case"),E=e("./lib/words/pub-id"),S=e("./lib/words/exceptions")},{"./lib/punctuation/dash":1,"./lib/punctuation/double-quotes":2,"./lib/punctuation/ellipsis":3,"./lib/punctuation/hyphen":4,"./lib/punctuation/period":6,"./lib/punctuation/single-quotes":7,"./lib/symbols/copyrights":8,"./lib/symbols/exponents":9,"./lib/symbols/marks":10,"./lib/symbols/multiplication-sign":11,"./lib/symbols/number-sign":12,"./lib/symbols/plus-minus":13,"./lib/symbols/section-sign":14,"./lib/whitespace/lines":15,"./lib/whitespace/nbsp":16,"./lib/whitespace/spaces":17,"./lib/words/abbreviations":18,"./lib/words/case":19,"./lib/words/exceptions":20,"./lib/words/pub-id":21,"./locale/locale":25}]},{},[28])(28)}); \ No newline at end of file diff --git a/src/lib/symbols/copyrights.js b/src/lib/symbols/copyrights.js index 62d410d..7e98f0c 100644 --- a/src/lib/symbols/copyrights.js +++ b/src/lib/symbols/copyrights.js @@ -37,9 +37,9 @@ export function replaceCopyright(string, copyrightLetter, copyrightSign, locale) * @returns {string} - The string with the consolidated spaces around the copyright sign */ export function consolidateSpaces(string, copyrightSign, locale) { - string = addSpaceBeforeSymbol(string, locale, copyrightSign); - string = addNbspAfterSymbol(string, locale, copyrightSign); - string = replaceSpacesWithNbspAfterSymbol(string, locale, copyrightSign); + string = addSpaceBeforeSymbol(string, copyrightSign, locale); + string = addNbspAfterSymbol(string, copyrightSign, locale); + string = replaceSpacesWithNbspAfterSymbol(string, copyrightSign, locale); return string; } diff --git a/src/lib/whitespace/nbsp.js b/src/lib/whitespace/nbsp.js index abb15ee..64ad96d 100644 --- a/src/lib/whitespace/nbsp.js +++ b/src/lib/whitespace/nbsp.js @@ -335,7 +335,7 @@ export function addNbspBeforeSingleLetter(string, locale) { @param {string} string — input text for identification @returns {string} — output with correctly added non-breaking space */ -export function addNbspAfterSymbol(string, locale, symbol) { +export function addNbspAfterSymbol(string, symbol, locale) { let pattern = "("+ symbol +")([^" + locale.spaces + "])"; let re = new RegExp(pattern, "g"); let replacement = "$1" + locale.nbsp + "$2"; @@ -351,7 +351,7 @@ export function addNbspAfterSymbol(string, locale, symbol) { @param {string} string — input text for identification @returns {string} — output with correctly placed non-breaking space */ -export function replaceSpacesWithNbspAfterSymbol(string, locale, symbol) { +export function replaceSpacesWithNbspAfterSymbol(string, symbol, locale) { let pattern = "("+ symbol +")([" + locale.spaces + "])"; let re = new RegExp(pattern, "g"); let replacement = "$1" + locale.nbsp; diff --git a/src/lib/whitespace/spaces.js b/src/lib/whitespace/spaces.js index 7a27ec6..f6b631a 100644 --- a/src/lib/whitespace/spaces.js +++ b/src/lib/whitespace/spaces.js @@ -249,7 +249,7 @@ export function addSpaceAfterClosingBrackets(string, locale) { -export function addSpaceBeforeSymbol(string, locale, symbol) { +export function addSpaceBeforeSymbol(string, symbol, locale) { let pattern = "([^" + locale.spaces + locale.openingBrackets + "])("+ symbol +")"; let re = new RegExp(pattern, "g"); let replacement = "$1" + locale.space + "$2"; diff --git a/src/test/whitespace/nbsp.test.js b/src/test/whitespace/nbsp.test.js index 2e8a625..8ae6222 100644 --- a/src/test/whitespace/nbsp.test.js +++ b/src/test/whitespace/nbsp.test.js @@ -653,7 +653,7 @@ describe('Add space after symbol, e.g. ©\n', () => { Object.keys(testCase).forEach((key) => { it("just unit tests", () => { - assert.strictEqual(addNbspAfterSymbol(key, new Locale("en-us"), "©"), testCase[key]); + assert.strictEqual(addNbspAfterSymbol(key, "©", new Locale("en-us")), testCase[key]); }); }); }); @@ -669,7 +669,7 @@ describe('Replaces various spaces with non-breaking space after symbol, e.g. ©\ Object.keys(testCase).forEach((key) => { it("just unit tests", () => { - assert.strictEqual(replaceSpacesWithNbspAfterSymbol(key, new Locale("en-us"), "©"), testCase[key]); + assert.strictEqual(replaceSpacesWithNbspAfterSymbol(key, "©", new Locale("en-us")), testCase[key]); }); }); }); diff --git a/src/test/whitespace/spaces.test.js b/src/test/whitespace/spaces.test.js index 88d872c..23d5242 100644 --- a/src/test/whitespace/spaces.test.js +++ b/src/test/whitespace/spaces.test.js @@ -390,7 +390,7 @@ describe('Remove trailing spaces\n', () => { -describe('Add space before symbol, e.g. ©\n', () => { +describe('Add space before a symbol, e.g. ©\n', () => { let testCase = { "© 2017": "© 2017", "(© 2017)": "(© 2017)", @@ -399,7 +399,12 @@ describe('Add space before symbol, e.g. ©\n', () => { Object.keys(testCase).forEach((key) => { it("unit test", () => { - assert.strictEqual(addSpaceBeforeSymbol(key, new Locale("en-us"), "©"), testCase[key]); + assert.strictEqual( + addSpaceBeforeSymbol( + key, + "©", + new Locale("en-us") + ), testCase[key]); }); }); }); From 706a2584b41c03a9d097382810dddfadd4323746 Mon Sep 17 00:00:00 2001 From: Brano Sandala Date: Sun, 22 Sep 2024 14:39:47 +0200 Subject: [PATCH 4/5] Update dependencies --- CHANGELOG.md | 4 ++-- package.json | 2 +- pnpm-lock.yaml | 32 ++++++++++++++++---------------- src/lib/words/abbreviations.js | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56e1d7e..56a194f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ -## 2.5.8 // +## 2.5.8 // 2024-09-22 ### 💪 Improvements - Fix Service Mark, when indicated in brackets, i.e. `Brand(sm)` → `Brand℠` @@ -11,7 +11,7 @@ - Add a build automation - Automate copyright notice updates in source and dist files - Refactor code for Registered Trademark (®), Trademark (™), Copyright (©), and Sound Recording Copyright (℗) -- +- Update dev dependencies to their latest versions diff --git a/package.json b/package.json index 33b2741..b59517f 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "babelify": "^10.0.0", "browser-sync": "^3.0.2", "browserify": "^17.0.0", - "eslint": "^9.10.0", + "eslint": "^9.11.0", "gulp": "^5.0.0", "gulp-babel": "^8.0.0", "gulp-cli": "^3.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 34fd100..17e1a5d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,8 +30,8 @@ importers: specifier: ^17.0.0 version: 17.0.0 eslint: - specifier: ^9.10.0 - version: 9.10.0 + specifier: ^9.11.0 + version: 9.11.0 gulp: specifier: ^5.0.0 version: 5.0.0 @@ -681,16 +681,16 @@ packages: resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.10.0': - resolution: {integrity: sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==} + '@eslint/js@9.11.0': + resolution: {integrity: sha512-LPkkenkDqyzTFauZLLAPhIb48fj6drrfMvRGSL9tS3AcZBSVTllemLSNyCvHNNL2t797S/6DJNSIwRwXgMO/eQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.1.0': - resolution: {integrity: sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==} + '@eslint/plugin-kit@0.2.0': + resolution: {integrity: sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@gulp-sourcemaps/identity-map@2.0.1': @@ -1427,8 +1427,8 @@ packages: resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.10.0: - resolution: {integrity: sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==} + eslint@9.11.0: + resolution: {integrity: sha512-yVS6XODx+tMFMDFcG4+Hlh+qG7RM6cCJXtQhCKLSsr3XkLvWggHjCqjfh0XsPPnt1c56oaT6PMgW9XWQQjdHXA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -3882,9 +3882,9 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 - '@eslint-community/eslint-utils@4.4.0(eslint@9.10.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.11.0)': dependencies: - eslint: 9.10.0 + eslint: 9.11.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.0': {} @@ -3911,11 +3911,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.10.0': {} + '@eslint/js@9.11.0': {} '@eslint/object-schema@2.1.4': {} - '@eslint/plugin-kit@0.1.0': + '@eslint/plugin-kit@0.2.0': dependencies: levn: 0.4.1 @@ -4803,14 +4803,14 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.10.0: + eslint@9.11.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.10.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.0) '@eslint-community/regexpp': 4.11.0 '@eslint/config-array': 0.18.0 '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.10.0 - '@eslint/plugin-kit': 0.1.0 + '@eslint/js': 9.11.0 + '@eslint/plugin-kit': 0.2.0 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 diff --git a/src/lib/words/abbreviations.js b/src/lib/words/abbreviations.js index b5c14bb..8ceb256 100644 --- a/src/lib/words/abbreviations.js +++ b/src/lib/words/abbreviations.js @@ -67,7 +67,7 @@ export function fixInitials(string, locale) { [2] Change multiple-word abbreviations from all locales abbr. patterns [3] Identify and fix multiple-word abbreviations before the word [4] Identify and fix multiple-word abbreviations after the word or on their own - + @param {string} input text for identification @returns {string} corrected output */ From 05b859419ebca8e8f1614a0acb73bc546065cd4b Mon Sep 17 00:00:00 2001 From: Brano Sandala Date: Sun, 22 Sep 2024 14:40:29 +0200 Subject: [PATCH 5/5] Update version --- dist/typopo.min.js | 2 +- dist/typopo_dist.min.js | 2 +- package.json | 2 +- src/typopo.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/typopo.min.js b/dist/typopo.min.js index 557f915..eb71ca6 100644 --- a/dist/typopo.min.js +++ b/dist/typopo.min.js @@ -1,5 +1,5 @@ /*! - * Typopo v2.5.7 (https://typopo.org) + * Typopo v2.5.8 (https://typopo.org) * Copyright 2015–2024 Braňo Šandala (https://brano.me) * Licensed under MIT (https://github.com/surfinzap/typopo/blob/main/LICENSE.txt) */ diff --git a/dist/typopo_dist.min.js b/dist/typopo_dist.min.js index a8f85ef..49ee49c 100644 --- a/dist/typopo_dist.min.js +++ b/dist/typopo_dist.min.js @@ -1,5 +1,5 @@ /*! - * Typopo v2.5.7 (https://typopo.org) + * Typopo v2.5.8 (https://typopo.org) * Copyright 2015–2024 Braňo Šandala (https://brano.me) * Licensed under MIT (https://github.com/surfinzap/typopo/blob/main/LICENSE.txt) */ diff --git a/package.json b/package.json index b59517f..7da33df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typopo", - "version": "2.5.7", + "version": "2.5.8", "description": "Fix frequent microtypography errors in multiple languages. Write neat texts without bothering about typography rules. Typopo works for English, German, Slovak, Czech and Rusyn language.", "license": "MIT", "author": { diff --git a/src/typopo.js b/src/typopo.js index 4804003..cf541ee 100644 --- a/src/typopo.js +++ b/src/typopo.js @@ -1,5 +1,5 @@ /*! - * Typopo v2.5.7 (https://typopo.org) + * Typopo v2.5.8 (https://typopo.org) * Copyright 2015–2024 Braňo Šandala (https://brano.me) * Licensed under MIT (https://github.com/surfinzap/typopo/blob/main/LICENSE.txt) */