From: Ian Jackson Date: Sun, 17 Apr 2022 23:06:15 +0000 (+0100) Subject: Fix another HTML syntax error X-Git-Tag: otter-1.1.0~495 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1d4bb70f18f24479b009d491099cccf24ada7931;p=otter.git Fix another HTML syntax error Define the type of `otherwise`, to be an Html variant. And pass HtmlStr values. Otherwise the HTML gets re-escaped, leading to a xyntax error. An effect of this is that the hollow diamond is actually hollow now. Signed-off-by: Ian Jackson --- diff --git a/src/pieces.rs b/src/pieces.rs index e7123e99..e06d8e39 100644 --- a/src/pieces.rs +++ b/src/pieces.rs @@ -273,7 +273,9 @@ impl GenericSimpleShape &self, f: &mut Html, face: FaceId, stroke_attrs_hook: &mut dyn FnMut(&mut Html) -> Result<(),IE>, ) { - let ef = |f: &mut Html, cmap: &ColourMap, attrname: &str, otherwise| { + let ef = |f: &mut Html, + cmap: &ColourMap, attrname: &str, + otherwise: &HtmlStr| { if let Some(colour) = cmap.get(face) { hwrite!(f, r##" {}="{}""##, attrname, colour) } else { @@ -289,12 +291,12 @@ impl GenericSimpleShape &path)?; } hwrite!(f, r##""##, &path)?; } }