Skip to main content

oak_markdown/language/
mod.rs

1use oak_core::{Language, LanguageCategory};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
5pub struct MarkdownLanguage {
6    pub allow_math: bool,
7}
8
9impl Language for MarkdownLanguage {
10    const NAME: &'static str = "markdown";
11    const CATEGORY: LanguageCategory = LanguageCategory::Markup;
12
13    type TokenType = crate::kind::MarkdownSyntaxKind;
14    type ElementType = crate::kind::MarkdownSyntaxKind;
15    type TypedRoot = crate::ast::MarkdownRoot;
16}
17
18impl Default for MarkdownLanguage {
19    fn default() -> Self {
20        Self { allow_math: false }
21    }
22}