original_docstring: Process all links in given html and replace them if markup is added.
docstring: Process all links in given html and replace them if markup is added.
docstring_tokens: Process all links in given html and replace them if markup is added .
code: def parse_links(html, encoding=None):
      """Process all links in given html and replace them if markup is added."""
      if encoding is None:
          encoding = settings.DEFAULT_CHARSET
      html = html.decode(encoding)
      html = expand_db_html(html)
      soup = BeautifulSoup(html, 'html.parser')
      link_tags = get_link_tags(soup)
      for tag in link_tags:
          original_link = str(tag)
          link_with_markup = add_link_markup(tag)
          if link_with_markup:
              html = html.replace(original_link, link_with_markup)
  
      return html.encode(encoding)
code_tokens: def parse_links ( html , encoding = None ) : if encoding is None : encoding = settings . DEFAULT_CHARSET html = html . decode ( encoding ) html = expand_db_html ( html ) soup = BeautifulSoup ( html , 'html.parser' ) link_tags = get_link_tags ( soup ) for tag in link_tags : original_link = str ( tag ) link_with_markup = add_link_markup ( tag ) if link_with_markup : html = html . replace ( original_link , link_with_markup ) return html . encode ( encoding )
short_docstring: Process all links in given html and replace them if markup is added.
short_docstring_tokens: Process all links in given html and replace them if markup is added .
comment: """Process all links in given html and replace them if markup is added."""