Fix dependant workspace members
continuous-integration/drone/pr Build encountered an error Details

This commit is contained in:
Emi Tatsuo 2020-12-10 11:53:57 -05:00
parent 3dadcc05ba
commit 5a6208dedf
No known key found for this signature in database
GPG Key ID: 68FAB2E2E6DFC98B
4 changed files with 9 additions and 4 deletions

View File

@ -224,7 +224,7 @@ pub fn render(body: &str) -> StyledString {
styled.append(StyledString::styled(name, Style::from(Effect::Underline)))
}
},
Preformatted(data) => styled.append(StyledString::plain(data)),
Preformatted { body, .. } => styled.append(StyledString::plain(body)),
Heading { level, body } => styled.append(StyledString::styled(
format!("{} {}", "#".repeat(level as usize), body),
Style::from(Effect::Bold),

View File

@ -25,7 +25,7 @@ fn gem_to_md(tcana: Vec<Node>, out: &mut impl Write) -> io::Result<()> {
Some(name) => write!(out, "[{}]({})\n\n", name, to)?,
None => write!(out, "[{0}]({0})", to)?,
},
Preformatted(body) => write!(out, "```\n{}\n```\n\n", body)?,
Preformatted { alt, body } => write!(out, "```{}\n{}\n```\n\n", alt, body)?,
Heading { level, body } => {
write!(out, "##{} {}\n\n", "#".repeat(level as usize), body)?
}

View File

@ -80,7 +80,12 @@ fn gemtext_to_html(inp: Vec<u8>) -> (String, impl ToHtml) {
name.as_ref().or(Some(&to.to_string())).unwrap()
)
.unwrap(),
Preformatted(body) => write!(buf, "<code><pre>{}</pre></code>", body).unwrap(),
Preformatted { alt, body } => write!(
buf,
"<code><pre title = \"{}\">{}</pre></code>",
alt.replace("\"", "\\\"").replace("\\", "\\\\"),
body
).unwrap(),
ListItem(body) => write!(buf, "<li>{}</li>", body).unwrap(),
Quote(body) => write!(buf, "<blockquote>{}</blockquote>", body).unwrap(),
}

View File

@ -56,7 +56,7 @@ async fn dice(req: Request) -> Result<Response, Error> {
.text("")
.text(format!("You rolled {} and you got:", dice))
.text("")
.preformatted(format!("{}", dice_roll(dice)?))
.preformatted("", format!("{}", dice_roll(dice)?))
.text("")
.link("/dice", Some("Do another roll".to_string()));