From 5e010fbb2867bbde6d42d56e9cd11aaabf74b290 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 17 Jan 2025 12:15:50 +0100 Subject: [PATCH] Rename file toc.rs --- src/frontend/api.rs | 3 +-- src/frontend/markdown/mod.rs | 7 ++++--- src/frontend/markdown/{toc.rs => table_of_contents.rs} | 0 3 files changed, 5 insertions(+), 5 deletions(-) rename src/frontend/markdown/{toc.rs => table_of_contents.rs} (100%) 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