Skip to content

Commit 47bba3b

Browse files
committed
Add description of fragment to documentation
Fixes servo#318
1 parent deebe96 commit 47bba3b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,15 @@ impl Url {
10121012

10131013
/// Return this URL’s fragment identifier, if any.
10141014
///
1015+
/// A fragment is the part of the URL after the `#` symbol.
1016+
/// The fragment is optional and, if present, contains a fragment identifier
1017+
/// that identifies a secondary resource, such as a section heading
1018+
/// of a document.
1019+
///
1020+
/// In HTML, the fragment identifier is usually the id attribute of a an element
1021+
/// that is scrolled to on load. Browsers typically will not send the fragment portion
1022+
/// of a URL to the server.
1023+
///
10151024
/// **Note:** the parser did *not* percent-encode this component,
10161025
/// but the input may have been percent-encoded already.
10171026
pub fn fragment(&self) -> Option<&str> {

0 commit comments

Comments
 (0)