gtx-cli 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# gtx-cli
|
|
2
2
|
|
|
3
|
+
## 2.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#665](https://github.com/generaltranslation/gt/pull/665) [`814cb12`](https://github.com/generaltranslation/gt/commit/814cb122e68a51ea1a513e9f6e51249af345db64) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Migrating CLI to gt-remark plugin, updating plugin
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`814cb12`](https://github.com/generaltranslation/gt/commit/814cb122e68a51ea1a513e9f6e51249af345db64)]:
|
|
10
|
+
- gt-remark@1.0.1
|
|
11
|
+
|
|
3
12
|
## 2.3.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -5,7 +5,7 @@ import remarkFrontmatter from 'remark-frontmatter';
|
|
|
5
5
|
import remarkStringify from 'remark-stringify';
|
|
6
6
|
import { visit } from 'unist-util-visit';
|
|
7
7
|
import { logWarning } from '../console/logging.js';
|
|
8
|
-
import
|
|
8
|
+
import escapeHtmlInTextNodes from 'gt-remark';
|
|
9
9
|
/**
|
|
10
10
|
* Generates a slug from heading text
|
|
11
11
|
*/
|
|
@@ -7,7 +7,7 @@ import remarkMdx from 'remark-mdx';
|
|
|
7
7
|
import remarkFrontmatter from 'remark-frontmatter';
|
|
8
8
|
import remarkStringify from 'remark-stringify';
|
|
9
9
|
import { visit } from 'unist-util-visit';
|
|
10
|
-
import
|
|
10
|
+
import escapeHtmlInTextNodes from 'gt-remark';
|
|
11
11
|
const { isMatch } = micromatch;
|
|
12
12
|
/**
|
|
13
13
|
* Localizes static urls in content files.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtx-cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"bin": "dist/main.js",
|
|
6
6
|
"files": [
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"fast-glob": "^3.3.3",
|
|
89
89
|
"form-data": "^4.0.4",
|
|
90
90
|
"generaltranslation": "^7.6.2",
|
|
91
|
+
"gt-remark": "^1.0.1",
|
|
91
92
|
"json-pointer": "^0.6.2",
|
|
92
93
|
"jsonpath-plus": "^10.3.0",
|
|
93
94
|
"jsonpointer": "^5.0.1",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from 'unified';
|
|
2
|
-
import type { Root } from 'mdast';
|
|
3
|
-
/**
|
|
4
|
-
* Escape HTML-sensitive characters ('{', '}', `&`, `<`, `>`, `"`, `'`) in text nodes,
|
|
5
|
-
* leaving code, math, MDX expressions, and front-matter untouched.
|
|
6
|
-
* Ensures literals render safely without altering already-escaped entities.
|
|
7
|
-
*/
|
|
8
|
-
export declare const escapeHtmlInTextNodes: Plugin<[], Root>;
|
package/dist/utils/escapeHtml.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { findAndReplace } from 'mdast-util-find-and-replace';
|
|
2
|
-
const IGNORE_PARENTS = [
|
|
3
|
-
'code',
|
|
4
|
-
'inlineCode',
|
|
5
|
-
'mdxFlowExpression',
|
|
6
|
-
'mdxTextExpression',
|
|
7
|
-
'mdxjsEsm',
|
|
8
|
-
'heading',
|
|
9
|
-
'yaml',
|
|
10
|
-
'toml',
|
|
11
|
-
'math',
|
|
12
|
-
'inlineMath',
|
|
13
|
-
];
|
|
14
|
-
// & that is NOT already an entity: &word; { ᨫ
|
|
15
|
-
const AMP_NOT_ENTITY = /&(?![a-zA-Z][a-zA-Z0-9]*;|#\d+;|#x[0-9A-Fa-f]+;)/g;
|
|
16
|
-
/**
|
|
17
|
-
* Escape HTML-sensitive characters ('{', '}', `&`, `<`, `>`, `"`, `'`) in text nodes,
|
|
18
|
-
* leaving code, math, MDX expressions, and front-matter untouched.
|
|
19
|
-
* Ensures literals render safely without altering already-escaped entities.
|
|
20
|
-
*/
|
|
21
|
-
export const escapeHtmlInTextNodes = function () {
|
|
22
|
-
return (tree) => {
|
|
23
|
-
findAndReplace(tree, [
|
|
24
|
-
// Order matters: & first (idempotency), then the rest
|
|
25
|
-
[AMP_NOT_ENTITY, '&'],
|
|
26
|
-
[/\{/g, '{'],
|
|
27
|
-
[/\}/g, '}'],
|
|
28
|
-
[/</g, '<'],
|
|
29
|
-
[/>/g, '>'],
|
|
30
|
-
[/"/g, '"'],
|
|
31
|
-
[/'/g, '''],
|
|
32
|
-
], { ignore: IGNORE_PARENTS });
|
|
33
|
-
};
|
|
34
|
-
};
|