Skip to content

Commit abcb111

Browse files
committed
Add description of fragment to documentation
Fixes #318
1 parent 2641e36 commit abcb111

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib.rs

+9
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,15 @@ impl Url {
884884

885885
/// Return this URL’s fragment identifier, if any.
886886
///
887+
/// A fragment is the part of the URL after the `#` symbol.
888+
/// The fragment is optional and, if present, contains a fragment identifier
889+
/// that identifies a secondary resource, such as a section heading
890+
/// of a document.
891+
///
892+
/// In HTML, the fragment identifier is usually the id attribute of a an element
893+
/// that is scrolled to on load. Browsers typically will not send the fragment portion
894+
/// of a URL to the server.
895+
///
887896
/// **Note:** the parser did *not* percent-encode this component,
888897
/// but the input may have been percent-encoded already.
889898
pub fn fragment(&self) -> Option<&str> {

0 commit comments

Comments
 (0)