gtx-cli 2.3.14 → 2.3.15
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 +6 -0
- package/dist/utils/localizeStaticUrls.js +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# gtx-cli
|
|
2
2
|
|
|
3
|
+
## 2.3.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#741](https://github.com/generaltranslation/gt/pull/741) [`559c0bf`](https://github.com/generaltranslation/gt/commit/559c0bfa7ff9e6664f65317eddbab419682a3c95) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Avoid localizing relative MDX links
|
|
8
|
+
|
|
3
9
|
## 2.3.14
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -256,6 +256,18 @@ function transformMdxUrls(mdxContent, defaultLocale, targetLocale, hideDefaultLo
|
|
|
256
256
|
}
|
|
257
257
|
// Helper function to transform URL based on pattern
|
|
258
258
|
const transformUrl = (originalUrl, linkType) => {
|
|
259
|
+
// For Markdown links [text](path), only process absolute-root paths starting with '/'
|
|
260
|
+
// Relative markdown links should remain relative to the current page and not be localized.
|
|
261
|
+
if (linkType === 'markdown') {
|
|
262
|
+
const isFragment = /^\s*#/.test(originalUrl);
|
|
263
|
+
const isAbsoluteRoot = originalUrl.startsWith('/');
|
|
264
|
+
const looksAbsoluteWithDomain = baseDomain
|
|
265
|
+
? shouldProcessAbsoluteUrl(originalUrl, baseDomain)
|
|
266
|
+
: false;
|
|
267
|
+
if (!isAbsoluteRoot && !looksAbsoluteWithDomain && !isFragment) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
259
271
|
// Check if URL should be processed
|
|
260
272
|
if (!shouldProcessUrl(originalUrl, patternHead, targetLocale, defaultLocale, baseDomain)) {
|
|
261
273
|
return null;
|