pub fn parse_image(offset: usize, text: &str, link_type: LinkType) -> Result<Node, ParseError> {
  let mut char_scanner = CharScanner::new(offset, text);
  let start_pos = char_scanner.pos();

  match link_type {
    LinkType::Inline => parse_inline(start_pos, &mut char_scanner),
    LinkType::Reference | LinkType::ReferenceUnknown | LinkType::Collapsed | LinkType::CollapsedUnknown => parse_reference(start_pos, &mut char_scanner),
    LinkType::Shortcut | LinkType::ShortcutUnknown | LinkType::Email | LinkType::Autolink => Err(ParseError::new(
      Range { start: offset, end: offset },
      &format!("Link type not implemented {:?}", link_type),
    )),
  }
}
/// Crudely parses out an image assuming the text is a image.
/// This is done because images have their references inlined by cmark.
Crudely parses out an image assuming the text is a image.
This is done because images have their references inlined by cmark.
Crudely parses out an image assuming the text is a image . This is done because images have their references inlined by cmark .
pub fn parse_image(offset: usize, text: &str, link_type: LinkType) -> Result<Node, ParseError> {
  let mut char_scanner = CharScanner::new(offset, text);
  let start_pos = char_scanner.pos();
  match link_type {
    LinkType::Inline => parse_inline(start_pos, &mut char_scanner),
    LinkType::Reference | LinkType::ReferenceUnknown | LinkType::Collapsed | LinkType::CollapsedUnknown => parse_reference(start_pos, &mut char_scanner),
    LinkType::Shortcut | LinkType::ShortcutUnknown | LinkType::Email | LinkType::Autolink => Err(ParseError::new(
      Range { start: offset, end: offset },
      &format!("Link type not implemented {:?}", link_type),
    )),
  }
}
pub fn parse_image ( offset : usize , text : & str , link_type : LinkType ) -> Result < Node , ParseError > { let mut char_scanner = CharScanner :: new ( offset , text ) ; let start_pos = char_scanner . pos ( ) ; match link_type { LinkType :: Inline => parse_inline ( start_pos , & mut char_scanner ) , LinkType :: Reference | LinkType :: ReferenceUnknown | LinkType :: Collapsed | LinkType :: CollapsedUnknown => parse_reference ( start_pos , & mut char_scanner ) , LinkType :: Shortcut | LinkType :: ShortcutUnknown | LinkType :: Email | LinkType :: Autolink => Err ( ParseError :: new ( Range { start : offset , end : offset } , & format ! ( " " link_type ) , ) ) , } }
Crudely parses out an image assuming the text is a image.
Crudely parses out an image assuming the text is a image .
offset
usize
text
&str
link_type
LinkType
offset
usize
text
&str
link_type
LinkType