Skip to content

Commit

Permalink
fix format and removed file at #652
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Aug 16, 2024
1 parent 328d17c commit 923e36d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
- `cms.ts` file.

### Fixed
- Escape the `%` character in the URI.
- Escape the `%` character in the URI [#652].
- Updated deps: `std`, `liquidjs`, `preact`, `tailwindcss`, `xml`, `postcss`, `autoprefixer`, `unocss`, `terser`, `eta`, `lightningcss`, `markdown-it-attrs`, `decap-server`.
- Remove empty directories in `dest` folder.
- Watcher new files on Windows.
Expand Down Expand Up @@ -500,6 +500,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
[#647]: https://github.com/lumeland/lume/issues/647
[#649]: https://github.com/lumeland/lume/issues/649
[#651]: https://github.com/lumeland/lume/issues/651
[#652]: https://github.com/lumeland/lume/issues/652

[Unreleased]: https://github.com/lumeland/lume/compare/v2.2.4...HEAD
[2.2.4]: https://github.com/lumeland/lume/compare/v2.2.3...v2.2.4
Expand Down
2 changes: 1 addition & 1 deletion core/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class Page<D extends Data = Data> {
get outputPath(): string {
const url = this.data.url;
const outputPath = url.endsWith("/") ? url + "index.html" : url;
return decodeURIComponentSafe(outputPath)
return decodeURIComponentSafe(outputPath);
}

/** Returns the source path of this page */
Expand Down
2 changes: 1 addition & 1 deletion core/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export async function serveFile(
request: Request,
): Promise<Response> {
const url = new URL(request.url);
const pathname = decodeURIComponentSafe(url.pathname)
const pathname = decodeURIComponentSafe(url.pathname);
const path = posix.join(root, pathname);

try {
Expand Down
6 changes: 3 additions & 3 deletions core/utils/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ export function resolveInclude(
/**
* decodeURI() can't decode the `%` character, as it is used in any encoded character
*/
export function decodeURIComponentSafe(path: string): string{
return decodeURIComponent(path.replace(/%(?![0-9a-fA-F]+)/g, '%25'));
}
export function decodeURIComponentSafe(path: string): string {
return decodeURIComponent(path.replace(/%(?![0-9a-fA-F]+)/g, "%25"));
}
2 changes: 1 addition & 1 deletion tests/assets/symlinks/src/index.md

0 comments on commit 923e36d

Please sign in to comment.