Add support for plain links.
format Build format has succeeded Details
rust-test Build rust-test has succeeded Details
rust-clippy Build rust-clippy has succeeded Details
build-natter Build build-natter has succeeded Details

main
Tom Alexander 4 months ago
parent eb67327574
commit cb5d131097
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -1 +1 @@
!!!!!!!! plain_link
<a href="{.raw_link}">{.raw_link}</a>

@ -1,16 +1,21 @@
use serde::Serialize;
use super::macros::render;
use super::render_context::RenderContext;
use crate::error::CustomError;
use crate::intermediate::IPlainLink;
use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "plain_link")]
pub(crate) struct RenderPlainLink {
raw_link: String,
post_blank: organic::types::PostBlank,
}
rnoop!(RenderPlainLink, IPlainLink);
render!(RenderPlainLink, IPlainLink, original, _render_context, {
Ok(RenderPlainLink {
raw_link: original.raw_link.clone(),
post_blank: original.post_blank,
})
});

@ -1,5 +1,22 @@
use super::macros::inoop;
use super::macros::intermediate;
use crate::error::CustomError;
use organic::types::StandardProperties;
inoop!(IPlainLink, PlainLink);
#[derive(Debug, Clone)]
pub(crate) struct IPlainLink {
pub(crate) raw_link: String,
pub(crate) post_blank: organic::types::PostBlank,
}
intermediate!(
IPlainLink,
&'orig organic::types::PlainLink<'parse>,
original,
_intermediate_context,
{
Ok(IPlainLink {
raw_link: original.raw_link.to_owned(),
post_blank: original.get_post_blank(),
})
}
);

Loading…
Cancel
Save