fn string_without_closing_tag<T: Display>(
out: &mut impl Write,
text: T,
klass: Option<Class>,
href_context: &Option<HrefContext<'_, '_>>,
open_tag: bool,
) -> Option<&'static str>Expand description
This function writes text into out with some modifications depending on klass:
- If
klassisNone,textis written intooutwith no modification. - If
klassisSomebutklass.get_span()isNone, it writes the text wrapped in a<span>with the providedklass. - If
klassisSomeand has arustc_span::Span, it then tries to generate a link (<a>element) by retrieving the link information from thespan_correspondence_mapthat was filled inspan_map.rs::collect_spans_and_sources. If it cannot retrieve the information, then it’s the same as the second point (klassisSomebut doesn’t have arustc_span::Span).