Fix unbalanced anchor tags
This commit is contained in:
parent
dfa835178f
commit
cb24837ff0
6 changed files with 88 additions and 26 deletions
|
|
@ -2,12 +2,12 @@ use crate::{
|
|||
syntax::content::{Parseable, parser::lexeme::Lexeme},
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
#[derive(Default, Debug, Clone, Eq, PartialEq)]
|
||||
pub struct LineBreak {}
|
||||
|
||||
impl Parseable for LineBreak {
|
||||
fn probe(lexeme: &Lexeme) -> bool {
|
||||
lexeme.text() == "\n"
|
||||
lexeme.text() == "\n" && !lexeme.last()
|
||||
}
|
||||
|
||||
fn lex(_lexeme: &Lexeme) -> LineBreak {
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ pub struct Literal {
|
|||
}
|
||||
|
||||
impl Parseable for Literal {
|
||||
fn probe(_lexeme: &Lexeme) -> bool {
|
||||
true
|
||||
fn probe(lexeme: &Lexeme) -> bool {
|
||||
!(lexeme.last() && lexeme.is_whitespace())
|
||||
}
|
||||
|
||||
fn lex(lexeme: &Lexeme) -> Literal {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@ impl Paragraph {
|
|||
pub fn new(open: bool) -> Paragraph {
|
||||
Paragraph { open: Some(open) }
|
||||
}
|
||||
|
||||
pub fn probe_end(lexeme: &Lexeme) -> bool {
|
||||
lexeme.match_as_char('\n') && lexeme.match_next_as_char('\n')
|
||||
}
|
||||
}
|
||||
|
||||
impl Parseable for Paragraph {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue