Skip to content

Commit 2c7a855

Browse files
yanranxiaoxiimlinhanchao
authored andcommitted
fix: 修正 path 变量仍然存在替换不完全的反斜杠的问题
1 parent 1aace89 commit 2c7a855

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Change Log
22
All notable changes to the "markdown-image" extension will be documented in this file.
33

4+
## [1.1.43] - 2024-07-08
5+
6+
### Fixed
7+
- Fixed the issue where the `path` variable still had incomplete backslashes replaced.
8+
49
## [1.1.42] - 2024-07-01
510

611
### Fixed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ These values can be found in your S3 service provider dashboard
152152

153153
## Release Notes
154154

155+
### 1.1.43
156+
- Fixed the issue where the `path` variable still had incomplete backslashes replaced.
157+
155158
### 1.1.42
156159
- Fixed the issue where the `path` variable is not in Unix format when running at Microsoft Windows.
157160

README.zh-cn.md

+3
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ sudo yum install xclip
159159

160160
## 发布历史
161161

162+
### 1.1.43
163+
- 修正 `path` 变量仍然存在替换不完全的反斜杠的问题。
164+
162165
### 1.1.42
163166
- 修正 `path` 变量在 Windows 操作系统下不符合 Unix 格式的问题。
164167

README.zh-tw.md

+3
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ sudo yum install xclip
153153

154154
## 發布歷史
155155

156+
### 1.1.43
157+
- 修正 `path` 變量仍然存在替換不完全的反斜杠的問題。
158+
156159
### 1.1.42
157160
- 修正 `path` 變量在 Windows 作業系統下不符合 Unix 格式的問題。
158161

src/lib/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async function variableGetter (variable: string,
119119
return path.basename(getCurrentFilePath(), path.extname(getCurrentFilePath()));
120120
}
121121
case 'path': {
122-
return path.dirname(getCurrentFilePath()).replace(getCurrentRoot(), '').slice(1).replace('\\', '/');
122+
return path.dirname(getCurrentFilePath()).replace(getCurrentRoot(), '').slice(1).replace(/\\/g, '/');
123123
}
124124
case 'hash': {
125125
return hash(fs.readFileSync(filePath));

0 commit comments

Comments
 (0)