use std::any::Any; use std::cell::Ref; use std::collections::HashMap; use std::ops::Range; use std::rc::Rc; use crate::compiler::compiler::Compiler; use crate::compiler::compiler::Target; use crate::document::document::Document; use crate::document::document::DocumentAccessors; use crate::document::element::ContainerElement; use crate::document::element::ElemKind; use crate::document::element::Element; use crate::parser::parser::ParserState; use crate::parser::rule::Rule; use crate::parser::source::Cursor; use crate::parser::source::Source; use crate::parser::source::Token; use crate::parser::source::VirtualSource; use crate::parser::util; use crate::parser::util::process_escaped; use crate::parser::util::Property; use crate::parser::util::PropertyMapError; use crate::parser::util::PropertyParser; use ariadne::Label; use ariadne::Report; use ariadne::ReportKind; use regex::Match; use regex::Regex; #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum MarkerKind { Open, Close, } #[derive(Debug)] pub struct ListMarker { pub(self) location: Token, pub(self) numbered: bool, pub(self) kind: MarkerKind, } impl Element for ListMarker { fn location(&self) -> &Token { &self.location } fn kind(&self) -> ElemKind { ElemKind::Block } fn element_name(&self) -> &'static str { "List Marker" } fn compile(&self, compiler: &Compiler, _document: &dyn Document) -> Result { match compiler.target() { Target::HTML => match (self.kind, self.numbered) { (MarkerKind::Close, true) => Ok("".to_string()), (MarkerKind::Close, false) => Ok("".to_string()), (MarkerKind::Open, true) => Ok("
    ".to_string()), (MarkerKind::Open, false) => Ok("