mirror of
https://github.com/YGGverse/ggemtext.git
synced 2026-03-31 17:15:33 +00:00
add comments
This commit is contained in:
parent
2e0a1ae3ef
commit
155247a2ea
7 changed files with 30 additions and 3 deletions
|
|
@ -1,17 +1,22 @@
|
|||
use glib::{GString, Regex, RegexCompileFlags, RegexMatchFlags};
|
||||
|
||||
/// [Header](https://geminiprotocol.net/docs/gemtext-specification.gmi#heading-lines) type holder
|
||||
pub enum Level {
|
||||
H1,
|
||||
H2,
|
||||
H3,
|
||||
}
|
||||
|
||||
/// [Header](https://geminiprotocol.net/docs/gemtext-specification.gmi#heading-lines) entity holder
|
||||
pub struct Header {
|
||||
pub value: GString,
|
||||
pub level: Level,
|
||||
}
|
||||
|
||||
impl Header {
|
||||
// Constructors
|
||||
|
||||
/// Parse `Self` from string
|
||||
pub fn from(line: &str) -> Option<Self> {
|
||||
// Parse line
|
||||
let regex = Regex::split_simple(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue