From 93d0e610723d21ae9c394f1163c60941970aabdf Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Tue, 5 Jun 2018 16:52:32 +0200 Subject: [PATCH] Update arabic.js --- plugins/arabic.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/arabic.js b/plugins/arabic.js index 16fa39d1c..93ee64036 100644 --- a/plugins/arabic.js +++ b/plugins/arabic.js @@ -236,6 +236,14 @@ arabicSubst = Object.assign(arabicSubst, arabicorigsubst); return initialForm; } + + var commonSubstition = function (character) { + var replacementTable = { + '(': ')', + ')': '(' + } + return replacementTable[character] || character; + } var processArabic = jsPDFAPI.processArabic = function (text, reverse) { text = text || ""; @@ -258,7 +266,7 @@ prevLetter = text[i - 1]; nextLetter = text[i + 1]; if (!isArabicLetter(currentLetter)) { - result += currentLetter; + result += reverse ? commonSubstition(currentLetter) : currentLetter; } else { if ( (prevLetter !== undefined)