Add a prefix to footnote IDs.
This avoids a conflict with multiple blog posts rendering in the same stream.
This commit is contained in:
@@ -10,6 +10,13 @@ pub(crate) struct RenderContext<'intermediate> {
|
||||
// TODO: Perhaps rename to output_root_directory.
|
||||
pub(crate) output_directory: &'intermediate Path,
|
||||
pub(crate) output_file: &'intermediate Path,
|
||||
|
||||
/// An optional string that gets added to IDs in HTML.
|
||||
///
|
||||
/// This is useful for cases where you may have conflicting HTML
|
||||
/// IDs, for example, multiple blog posts with footnotes in a blog
|
||||
/// stream.
|
||||
pub(crate) id_addition: Option<&'intermediate str>,
|
||||
}
|
||||
|
||||
impl<'intermediate> RenderContext<'intermediate> {
|
||||
@@ -17,11 +24,13 @@ impl<'intermediate> RenderContext<'intermediate> {
|
||||
config: &'intermediate Config,
|
||||
output_directory: &'intermediate Path,
|
||||
output_file: &'intermediate Path,
|
||||
id_addition: Option<&'intermediate str>,
|
||||
) -> Result<RenderContext<'intermediate>, CustomError> {
|
||||
Ok(RenderContext {
|
||||
config,
|
||||
output_directory,
|
||||
output_file,
|
||||
id_addition,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user