| 287 | } |
| 288 | |
| 289 | fn code<'a, 'b>( |
| 290 | mut o: impl Write + 'b, |
| 291 | state: &'b mut ParseState, |
| 292 | ) -> impl FnMut(&mut Partial<&'a str>) -> PResult<(), Error<'a>> + 'b { |
| 293 | move |i| { |
| 294 | "`".parse_next(i)?; |
| 295 | let code = terminated(take_until(0.., "`"), "`").parse_next(i)?; |
| 296 | let out = code.replace("&", "&").replace(">", ">").replace("<", "<"); |
| 297 | |
| 298 | queue_newline_or_advance(&mut o, state, out.width())?; |
| 299 | queue(&mut o, StyledText::success_fg())?; |
| 300 | queue(&mut o, style::Print(out))?; |
| 301 | queue(&mut o, StyledText::reset()) |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | fn blockquote<'a, 'b>( |
| 306 | mut o: impl Write + 'b, |