diff --git a/src/frontend/api.rs b/src/frontend/api.rs index 9b05f85..b004cc0 100644 --- a/src/frontend/api.rs +++ b/src/frontend/api.rs @@ -8,8 +8,7 @@ use crate::common::{ }; use http::{Method, StatusCode}; use leptos::{prelude::ServerFnError, server_fn::error::NoCustomError}; -use log::error; -use log::info; +use log::{error, info}; use serde::{Deserialize, Serialize}; use std::{fmt::Debug, sync::LazyLock}; use url::Url; diff --git a/src/frontend/markdown/mod.rs b/src/frontend/markdown/mod.rs index 8a74609..7bfc588 100644 --- a/src/frontend/markdown/mod.rs +++ b/src/frontend/markdown/mod.rs @@ -7,10 +7,11 @@ use markdown_it::{ }; use math_equation::MathEquationScanner; use std::sync::OnceLock; +use table_of_contents::{TocMarkerScanner, TocScanner}; pub mod article_link; pub mod math_equation; -pub mod toc; +pub mod table_of_contents; pub fn render_markdown(text: &str) -> String { static INSTANCE: OnceLock = OnceLock::new(); @@ -77,8 +78,8 @@ fn markdown_parser() -> MarkdownIt { // Ibis custom extensions parser.inline.add_rule::(); parser.inline.add_rule::(); - parser.inline.add_rule::(); - parser.add_rule::(); + parser.inline.add_rule::(); + parser.add_rule::(); parser } diff --git a/src/frontend/markdown/toc.rs b/src/frontend/markdown/table_of_contents.rs similarity index 100% rename from src/frontend/markdown/toc.rs rename to src/frontend/markdown/table_of_contents.rs