Skip to content

Commit

Permalink
Merge pull request #21 from web-infra-dev/fix/useless-quote
Browse files Browse the repository at this point in the history
fix: delete useless quote
  • Loading branch information
sanyuan0704 committed Mar 4, 2024
2 parents b5bdc94 + adb7b8b commit a6b3244
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
target: "aarch64-pc-windows-msvc"
build: pnpm build -- --target aarch64-pc-windows-msvc

name: stable - ${{ matrix.settings.target }} - node@14
name: stable - ${{ matrix.settings.target }} - node@16
runs-on: ${{ matrix.settings.host }}

steps:
Expand All @@ -109,7 +109,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
check-latest: true

- name: Install pnpm
Expand All @@ -126,13 +126,13 @@ jobs:
- name: Cache cargo
uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.settings.target }}-node@14-cargo-cache
key: ${{ matrix.settings.target }}-node@16-cargo-cache

- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: npm-cache-${{ matrix.settings.target }}-node@14-${{ hashFiles('pnpm-lock.yaml') }}
key: npm-cache-${{ matrix.settings.target }}-node@16-${{ hashFiles('pnpm-lock.yaml') }}

- name: Pull latest image
run: ${{ matrix.settings.docker }}
Expand Down
3 changes: 1 addition & 2 deletions crates/utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub fn extract_title_and_id(text_value: &str) -> (String, String) {
} else {
title.push_str(&text_value);
}
title = title.replace("\"", "\\\"").replace("'", "\\\'");
(title, custom_id)
}

Expand All @@ -40,7 +39,7 @@ mod tests {
#[test]
fn test_extract_title_and_id_with_quotes() {
let (title, custom_id) = extract_title_and_id("\"Hello' World\" {#id123}");
assert_eq!(title, "\\\"Hello\\' World\\\"");
assert_eq!(title, "\"Hello\' World\"");
assert_eq!(custom_id, "id123");
}
}

0 comments on commit a6b3244

Please sign in to comment.