File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,10 @@ match Multiline::begin_from("```alt") {
72
72
73
73
#### Header
74
74
75
+ ** Struct**
76
+
75
77
``` rust
76
- match Header :: from (" # H1" ) {
78
+ match Header :: parse (" # H1" ) {
77
79
Some (h1 ) => {
78
80
assert_eq! (h1 . level as u8 , Level :: H1 as u8 );
79
81
assert_eq! (h1 . value, " H1" );
@@ -82,6 +84,15 @@ match Header::from("# H1") {
82
84
} // H1, H2, H3
83
85
```
84
86
87
+ ** Trait**
88
+
89
+ ``` rust
90
+ use ggemtext :: line :: header :: {Gemtext , Level };
91
+ assert_eq! (" # H1" . as_value (), Some (" H1" ));
92
+ assert_eq! (" H1" . to_source (& Level :: H1 ), " # H1" );
93
+ // H1, H2, H3
94
+ ```
95
+
85
96
#### Link
86
97
87
98
``` rust
@@ -135,7 +146,7 @@ assert_eq!("Item".to_source(), "* Item")
135
146
** Struct**
136
147
137
148
``` rust
138
- match Quote :: from (" > Quote" ) {
149
+ match Quote :: parse (" > Quote" ) {
139
150
Some (quote ) => assert_eq! (quote . value, " Quote" ),
140
151
None => assert! (false ),
141
152
}
You can’t perform that action at this time.
0 commit comments