Skip to content

Commit 2386d9a

Browse files
committed
fix: Base path with a trailing slash
1 parent 3921466 commit 2386d9a

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
2-
[unreleased]
2+
3+
## [unreleased]
34
- [BREAKING] Rename `linear_gradient!` to `linearGradient!` for consistency with the other svg macros (same with `radial_gradient!` and `mesh_gradient!`).
5+
- Fixed `base_path` with a trailing slash parsing / handling.
46

57
## v0.7.0
68
- [BREAKING] Custom elements are now patched in-place (#364). Use `el_key` to force reinitialize an element.

examples/pages/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33

44
<head>
5-
<base href="/base/path">
5+
<base href="/base/path/">
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
88
<title>Pages example</title>

examples/url/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33

44
<head>
5-
<base href="ui">
5+
<base href="/ui/">
66

77
<meta charset="utf-8" />
88
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<Ms, Mdl, INodes: IntoNodes<Ms> + 'static, GMs: 'static> App<Ms, Mdl, INodes
168168
.and_then(|href| web_sys::Url::new_with_base(&href, DUMMY_BASE_URL).ok())
169169
.map(|url| {
170170
url.pathname()
171-
.trim_start_matches('/')
171+
.trim_matches('/')
172172
.split('/')
173173
.map(ToOwned::to_owned)
174174
.collect()

src/app/orders.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub trait Orders<Ms: 'static, GMs = UndefinedGMsg> {
277277
stream: impl Stream<Item = MsU> + 'static,
278278
) -> StreamHandle;
279279

280-
/// Cheap clone base path loaded from element `<base href="base/path">`.
280+
/// Cheap clone base path loaded from element `<base href="/base/path/">`.
281281
///
282282
/// Returns empty `Vec` if there is no `base` element in your HTML
283283
/// or there were problems with parsing.

0 commit comments

Comments
 (0)