@@ -14,22 +14,16 @@ use parser::{parse_stylesheet_rules, StylesheetParser};
14
14
15
15
/// Determine the character encoding of a CSS stylesheet and decode it.
16
16
///
17
- /// This is based on the presence of a :abbr:`BOM (Byte Order Mark)`,
18
- /// an `@charset` rule,
19
- /// and encoding meta-information.
17
+ /// This is based on the presence of a BOM (Byte Order Mark), an `@charset` rule, and
18
+ /// encoding meta-information.
20
19
///
21
- /// :param css_bytes: A byte string.
22
- /// :param protocol_encoding:
23
- /// The encoding label, if any, defined by HTTP or equivalent protocol.
20
+ /// * `css_bytes`: A byte string.
21
+ /// * `protocol_encoding`: The encoding label, if any, defined by HTTP or equivalent protocol.
24
22
/// (e.g. via the `charset` parameter of the `Content-Type` header.)
25
- /// :param environment_encoding:
26
- /// An optional `Encoding` object
27
- /// for the `environment encoding
28
- /// <http://www.w3.org/TR/css-syntax/#environment-encoding>`_,
29
- /// if any.
30
- /// :returns:
31
- /// A 2-tuple of a decoded Unicode string
32
- /// and the `Encoding` object that was used.
23
+ /// * `environment_encoding`: An optional `Encoding` object for the [environment encoding]
24
+ /// (http://www.w3.org/TR/css-syntax/#environment-encoding), if any.
25
+ ///
26
+ /// Returns a 2-tuple of a decoded Unicode string and the `Encoding` object that was used.
33
27
pub fn decode_stylesheet_bytes ( css : & [ u8 ] , protocol_encoding_label : Option < & str > ,
34
28
environment_encoding : Option < EncodingRef > )
35
29
-> ( String , EncodingRef ) {
@@ -78,18 +72,14 @@ fn decode_replace(input: &[u8], fallback_encoding: EncodingRef)-> (String, Encod
78
72
79
73
/// Parse stylesheet from bytes.
80
74
///
81
- /// :param css_bytes: A byte string.
82
- /// :param protocol_encoding:
83
- /// The encoding label, if any, defined by HTTP or equivalent protocol.
75
+ /// * `css_bytes`: A byte string.
76
+ /// * `protocol_encoding`: The encoding label, if any, defined by HTTP or equivalent protocol.
84
77
/// (e.g. via the `charset` parameter of the `Content-Type` header.)
85
- /// :param environment_encoding:
86
- /// An optional `Encoding` object
87
- /// for the `environment encoding
88
- /// <http://www.w3.org/TR/css-syntax/#environment-encoding>`_,
89
- /// if any.
90
- /// :returns:
91
- /// A 2-tuple of a Iterator<Result<Rule, SyntaxError>>
92
- /// and the `Encoding` object that was used.
78
+ /// * `environment_encoding`: An optional `Encoding` object for the [environment encoding]
79
+ /// (http://www.w3.org/TR/css-syntax/#environment-encoding), if any.
80
+ ///
81
+ /// Returns a 2-tuple of a `Iterator<Result<Rule, SyntaxError>>`
82
+ /// and the `Encoding` object that was used.
93
83
pub fn parse_stylesheet_rules_from_bytes (
94
84
css_bytes : & [ u8 ] , protocol_encoding_label : Option < & str > ,
95
85
environment_encoding : Option < EncodingRef > )
0 commit comments