antigravity-rtl-patcher 2.3.2 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +2 -2
- package/package.json +1 -1
- package/payload/preload-inject.js +3 -2
package/bin/cli.js
CHANGED
|
@@ -5,13 +5,13 @@ const chalk = require('chalk');
|
|
|
5
5
|
const { patch, restore, status } = require('../src/patcher');
|
|
6
6
|
|
|
7
7
|
const BANNER = `
|
|
8
|
-
${chalk.cyan('Antigravity Smart RTL Patcher')} ${chalk.gray('v2.3.
|
|
8
|
+
${chalk.cyan('Antigravity Smart RTL Patcher')} ${chalk.gray('v2.3.3')}
|
|
9
9
|
`;
|
|
10
10
|
|
|
11
11
|
program
|
|
12
12
|
.name('agy-rtl')
|
|
13
13
|
.description('RTL patcher for Antigravity')
|
|
14
|
-
.version('2.3.
|
|
14
|
+
.version('2.3.3');
|
|
15
15
|
|
|
16
16
|
program
|
|
17
17
|
.command('patch')
|
package/package.json
CHANGED
|
@@ -234,8 +234,9 @@ function _agyRtlRendererMain() {
|
|
|
234
234
|
if (!RTL_REGEX.test(text)) return false;
|
|
235
235
|
var m = text.match(RTL_CHAR_REGEX);
|
|
236
236
|
if (!m) return false;
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
// Calculate total word characters (removing spaces and punctuation)
|
|
238
|
+
var textLen = text.replace(/[\s\d\!\@\#\$\%\^\&\*\(\)\-\_\=\+\[\]\{\}\;\:\'\"\<\.\>\/\?\`\~\|\/\/،؛؟]/g, '').length;
|
|
239
|
+
return textLen > 0 && (m.length / textLen) >= MIN_RTL_RATIO;
|
|
239
240
|
}
|
|
240
241
|
var INLINE_TAGS = ['SPAN', 'A', 'STRONG', 'B', 'EM', 'I', 'CODE', 'MARK', 'LABEL', 'BR', 'KBD', 'S', 'STRIKE', 'U', 'SUB', 'SUP'];
|
|
241
242
|
var TEXT_BLOCKS = ['P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'BLOCKQUOTE', 'LI', 'TD', 'TH', 'BUTTON', 'TEXTAREA', 'INPUT'];
|