U
    h                     @  s>   d Z ddlmZ ddlmZ ddlmZ dddddd	Zd
S )zUtilities for generating HTML.    )annotations)ElementTree)	sheets_idzsheets_id.SheetsURLstr)urltextreturnc                 C  s8   t jdddt| dd}|r"|nd|_t j|ddd	S )
zReturns a HTML string representing an anchor tag.

  This class uses the xml.etree library to handle HTML escaping.

  Args:
    url: The Sheets URL to link to.
    text: The text body of the link.

  Returns:
    A string representing a HTML fragment.
  aZ_blankZnoopener)targetrelhref)attriblinkunicodehtml)encodingmethod)r   Elementr   r   tostring)r   r   tag r   K/tmp/pip-unpacked-wheel-doshhd5e/google/generativeai/notebook/html_utils.pyget_anchor_tag   s    r   N)__doc__
__future__r   Z	xml.etreer   Zgoogle.generativeai.notebookr   r   r   r   r   r   <module>   s   