1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! This module is here to abstract away some Unicode character checking.
//!
//! CommonMark has clear definitions for the different types of characters. I'm assuming the same
//! definitions for Djot.
//!
//! Many of these definitions are in terms of Unicode categories. I'm handling all characters as
//! single bytes, which is sufficient, since all the characters that _do_ something in a Djot
//! document are ASCII. However, some of the u8 utility functions included in std are not entirely
//! compliant with the definitions in CommonMark. This module exists to override these methods,
//! allowing me to make them spec compliant (and change them down the road, if Djot ends up with
//! different definitions.)
/// This checks if a byte is a carriage return or line feed, which both are defined as a "line
/// ending".
pub
/// This extends the std `is_ascii_whitespace` with the no break space (U+00A0) character, which is
/// included in the Unicode Zs category. This is required to make a byte-based whitespace check
/// that is compliant with Djot's definition of a whitespace character:
/// https://spec.commonmark.org/0.30/#unicode-whitespace-character
pub
/// Tabs and spaces are considered part of a "blank" line. This checks if a character matches any
/// of these.
pub
/// Wrapper function that allows extensibility down the road, and gives us a similar interface to
/// the functions defined above.
pub
/// Wrapper function that allows extensibility down the road, and gives us a similar interface to
/// the functions defined above.
pub
/// Wrapper function that allows extensibility down the road, and gives us a similar interface to
/// the functions defined above.
pub
/// Wrapper function that allows extensibility down the road, and gives us a similar interface to
/// the functions defined above.
pub
/// Wrapper function that allows extensibility down the road, and gives us a similar interface to
/// the functions defined above.
pub
/// Check if a character would be a valid in a URI.
///
/// Uses the syntax definition found
/// [here](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax) to define the valid
/// characters.
pub