From be03efced614ee260252e417c98229c5224c6458 Mon Sep 17 00:00:00 2001
From: igor <igor.markin@vereign.com>
Date: Mon, 6 Sep 2021 14:55:23 +0300
Subject: [PATCH] Add build

---
 dist/PlainNormalizer/PlainNormalizer.d.ts |  8 +++++---
 dist/PlainNormalizer/PlainNormalizer.js   | 19 ++++++++++++++-----
 dist/PlainNormalizer/index.d.ts           |  3 ++-
 dist/PlainNormalizer/index.js             |  1 +
 4 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/dist/PlainNormalizer/PlainNormalizer.d.ts b/dist/PlainNormalizer/PlainNormalizer.d.ts
index 478c821..2e78fc4 100644
--- a/dist/PlainNormalizer/PlainNormalizer.d.ts
+++ b/dist/PlainNormalizer/PlainNormalizer.d.ts
@@ -1,5 +1,7 @@
-export interface SealRemovalOptions {
-    sealUrl: string;
+export interface Options {
+    sealUrl?: string;
+    normalizeImagePlain?: boolean;
 }
-export declare const normalizePlainPart: (text: string, sealRemovalOptions?: SealRemovalOptions) => string;
+export declare const normalizePlainPart: (text: string, options?: Options) => string;
+export declare const cleanupImageText: (plain: string) => string;
 export declare const cleanupHiddenCharacters: (s: string) => string;
diff --git a/dist/PlainNormalizer/PlainNormalizer.js b/dist/PlainNormalizer/PlainNormalizer.js
index 6a76f10..dedea3f 100644
--- a/dist/PlainNormalizer/PlainNormalizer.js
+++ b/dist/PlainNormalizer/PlainNormalizer.js
@@ -1,16 +1,24 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
-exports.cleanupHiddenCharacters = exports.normalizePlainPart = void 0;
+exports.cleanupHiddenCharacters = exports.cleanupImageText = exports.normalizePlainPart = void 0;
 // this is a Node module. require is a must to work across different envs
 const URL = require("url-parse");
 const utils_1 = require("../utils");
-const normalizePlainPart = (text, sealRemovalOptions) => {
+const defaultOptions = {
+    normalizeImagePlain: true,
+};
+const normalizePlainPart = (text, options) => {
+    options = options
+        ? Object.assign(defaultOptions, Object.assign({}, options))
+        : defaultOptions;
     text = exports.cleanupHiddenCharacters(text);
     text = patchOutlookSafelinksWrappers(text);
-    if (sealRemovalOptions) {
-        text = removeSeal(text, sealRemovalOptions.sealUrl);
+    if (options === null || options === void 0 ? void 0 : options.sealUrl) {
+        text = removeSeal(text, options.sealUrl);
+    }
+    if (options === null || options === void 0 ? void 0 : options.normalizeImagePlain) {
+        text = exports.cleanupImageText(text);
     }
-    text = cleanupImageText(text);
     text = utils_1.normalizeTextSpacings(text);
     return text.trim();
 };
@@ -45,6 +53,7 @@ const cleanupImageText = (plain) => {
     const sealRegex = `\\[(image:\\s)(.*)\\]`;
     return plain.replace(new RegExp(sealRegex), "[$2]");
 };
+exports.cleanupImageText = cleanupImageText;
 const cleanupHiddenCharacters = (s) => {
     const removeSymbols = new RegExp(/[\u200B]+/g);
     return s.replace(removeSymbols, "");
diff --git a/dist/PlainNormalizer/index.d.ts b/dist/PlainNormalizer/index.d.ts
index 7fb02c4..b6c3560 100644
--- a/dist/PlainNormalizer/index.d.ts
+++ b/dist/PlainNormalizer/index.d.ts
@@ -1,4 +1,5 @@
 declare const _default: {
-    normalizePlain: (text: string, sealRemovalOptions?: import("./PlainNormalizer").SealRemovalOptions) => string;
+    normalizePlain: (text: string, options?: import("./PlainNormalizer").Options) => string;
+    cleanupImageText: (plain: string) => string;
 };
 export default _default;
diff --git a/dist/PlainNormalizer/index.js b/dist/PlainNormalizer/index.js
index 2a16ea5..9d5f0b0 100644
--- a/dist/PlainNormalizer/index.js
+++ b/dist/PlainNormalizer/index.js
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
 const PlainNormalizer_1 = require("./PlainNormalizer");
 exports.default = {
     normalizePlain: PlainNormalizer_1.normalizePlainPart,
+    cleanupImageText: PlainNormalizer_1.cleanupImageText,
 };
-- 
GitLab