diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-10-06 15:57:55 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-10-06 15:57:55 +0200 |
commit | cd5bb2d16c6b28332b0b6077b27b2b90a8051896 (patch) | |
tree | 848ebc6200b80d2dfdcd67bf0bb245eea06bb24f /src/to_html.rs | |
parent | 6e80e03bb6d6af47aba2b339f160e4895ab5afba (diff) | |
download | markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.tar.gz markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.tar.bz2 markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.zip |
Refactor to split parse from compile options
Diffstat (limited to 'src/to_html.rs')
-rw-r--r-- | src/to_html.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/to_html.rs b/src/to_html.rs index 814f7cf..a0ab152 100644 --- a/src/to_html.rs +++ b/src/to_html.rs @@ -12,7 +12,7 @@ use crate::util::{ skip, slice::{Position, Slice}, }; -use crate::{LineEnding, Options}; +use crate::{CompileOptions, LineEnding}; use alloc::{ format, string::{String, ToString}, @@ -81,7 +81,7 @@ struct CompileContext<'a> { /// List of bytes. bytes: &'a [u8], /// Configuration. - options: &'a Options, + options: &'a CompileOptions, // Fields used by handlers to track the things they need to track to // compile markdown. /// Rank of heading (atx). @@ -136,7 +136,7 @@ impl<'a> CompileContext<'a> { fn new( events: &'a [Event], bytes: &'a [u8], - options: &'a Options, + options: &'a CompileOptions, line_ending: LineEnding, ) -> CompileContext<'a> { CompileContext { @@ -208,7 +208,7 @@ impl<'a> CompileContext<'a> { } /// Turn events and bytes into a string of HTML. -pub fn compile(events: &[Event], bytes: &[u8], options: &Options) -> String { +pub fn compile(events: &[Event], bytes: &[u8], options: &CompileOptions) -> String { let mut index = 0; let mut line_ending_inferred = None; |