Skip to content

Commit dc5cf2b

Browse files
author
bors-servo
authored
Auto merge of #357 - tmccombs:fragment, r=SimonSapin
Add description of fragment to documentation Fixes #318, fixes #332. This builds on #332, and I hope addresses the comments there. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/357) <!-- Reviewable:end -->
2 parents 4e909f6 + abcb111 commit dc5cf2b

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
@@ -1002,6 +1002,15 @@ impl Url {
10021002

10031003
/// Return this URL’s fragment identifier, if any.
10041004
///
1005+
/// A fragment is the part of the URL after the `#` symbol.
1006+
/// The fragment is optional and, if present, contains a fragment identifier
1007+
/// that identifies a secondary resource, such as a section heading
1008+
/// of a document.
1009+
///
1010+
/// In HTML, the fragment identifier is usually the id attribute of a an element
1011+
/// that is scrolled to on load. Browsers typically will not send the fragment portion
1012+
/// of a URL to the server.
1013+
///
10051014
/// **Note:** the parser did *not* percent-encode this component,
10061015
/// but the input may have been percent-encoded already.
10071016
pub fn fragment(&self) -> Option<&str> {

0 commit comments

Comments
 (0)