| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
#[cfg(any(feature = "mentions", test))] |
| 13 |
mod code_spans; |
| 14 |
mod escape; |
| 15 |
mod render; |
| 16 |
mod sanitize; |
| 17 |
mod text; |
| 18 |
mod toc; |
| 19 |
|
| 20 |
#[cfg(feature = "directives")] |
| 21 |
mod directives; |
| 22 |
#[cfg(feature = "doc-loader")] |
| 23 |
mod doc_loader; |
| 24 |
#[cfg(feature = "frontmatter")] |
| 25 |
mod frontmatter; |
| 26 |
#[cfg(feature = "mentions")] |
| 27 |
mod mentions; |
| 28 |
#[cfg(feature = "quotes")] |
| 29 |
mod quotes; |
| 30 |
#[cfg(feature = "media-urls")] |
| 31 |
mod media_urls; |
| 32 |
|
| 33 |
|
| 34 |
pub use render::{RenderResult, Renderer}; |
| 35 |
pub use sanitize::SanitizePreset; |
| 36 |
pub use text::{extract_title, reading_time_minutes, strip_first_heading, word_count}; |
| 37 |
pub use toc::{TocEntry, extract_toc, render_toc_html}; |
| 38 |
|
| 39 |
|
| 40 |
#[cfg(feature = "directives")] |
| 41 |
pub use directives::post_process_directives; |
| 42 |
#[cfg(feature = "doc-loader")] |
| 43 |
pub use doc_loader::{DocIndexEntry, DocLoader, DocLoaderConfig, DocPage, DocSearchEntry}; |
| 44 |
#[cfg(feature = "frontmatter")] |
| 45 |
pub use frontmatter::{Frontmatter, parse_frontmatter}; |
| 46 |
#[cfg(feature = "mentions")] |
| 47 |
pub use mentions::{extract_mentions, resolve_mentions}; |
| 48 |
#[cfg(feature = "quotes")] |
| 49 |
pub use quotes::{QuoteAuthor, post_process_quotes}; |
| 50 |
#[cfg(feature = "media-urls")] |
| 51 |
pub use media_urls::{img_to_video, rewrite_media_paths}; |
| 52 |
|
| 53 |
|
| 54 |
pub fn render_permissive(markdown: &str) -> String { |
| 55 |
Renderer::permissive().render(markdown) |
| 56 |
} |
| 57 |
|
| 58 |
|
| 59 |
pub fn render_standard(markdown: &str) -> String { |
| 60 |
Renderer::standard().render(markdown) |
| 61 |
} |
| 62 |
|
| 63 |
|
| 64 |
pub fn render_strict(markdown: &str) -> String { |
| 65 |
Renderer::strict().render(markdown) |
| 66 |
} |
| 67 |
|
| 68 |
|
| 69 |
pub fn sanitize_html(html: &str) -> String { |
| 70 |
Renderer::sanitize_only().sanitize_html(html) |
| 71 |
} |
| 72 |
|