Fix unbalanced anchor tags

This commit is contained in:
Juno Takano 2026-01-05 00:35:38 -03:00
commit cb24837ff0
6 changed files with 88 additions and 26 deletions

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {