Use the raw timestamp source for rendering timestamps.
This commit is contained in:
parent
073ac0ac25
commit
c371b999d5
@ -1 +1 @@
|
||||
!!!!!!!! timestamp
|
||||
<span class="timestamp">{.source}</span>
|
||||
|
@ -1,16 +1,21 @@
|
||||
use serde::Serialize;
|
||||
|
||||
use super::macros::render;
|
||||
use super::render_context::RenderContext;
|
||||
use crate::error::CustomError;
|
||||
use crate::intermediate::ITimestamp;
|
||||
|
||||
use super::macros::rnoop;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename = "timestamp")]
|
||||
pub(crate) struct RenderTimestamp {
|
||||
source: String,
|
||||
post_blank: organic::types::PostBlank,
|
||||
}
|
||||
|
||||
rnoop!(RenderTimestamp, ITimestamp);
|
||||
render!(RenderTimestamp, ITimestamp, original, _render_context, {
|
||||
Ok(RenderTimestamp {
|
||||
source: original.source.clone(),
|
||||
post_blank: original.post_blank,
|
||||
})
|
||||
});
|
||||
|
@ -1,5 +1,24 @@
|
||||
use super::macros::inoop;
|
||||
use super::macros::intermediate;
|
||||
use super::util::coalesce_whitespace;
|
||||
use crate::error::CustomError;
|
||||
use organic::types::StandardProperties;
|
||||
|
||||
inoop!(ITimestamp, Timestamp);
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct ITimestamp {
|
||||
pub(crate) source: String,
|
||||
pub(crate) post_blank: organic::types::PostBlank,
|
||||
}
|
||||
|
||||
intermediate!(
|
||||
ITimestamp,
|
||||
&'orig organic::types::Timestamp<'parse>,
|
||||
original,
|
||||
_intermediate_context,
|
||||
{
|
||||
Ok(ITimestamp {
|
||||
source: coalesce_whitespace(original.source).into_owned(),
|
||||
post_blank: original.get_post_blank(),
|
||||
})
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user