code: def htmlquote(text):
      r
      text = text.replace(u"&", u"&amp;") # Must be done first!
      text = text.replace(u"<", u"&lt;")
      text = text.replace(u">", u"&gt;")
      text = text.replace(u"'", u"&#39;")
      text = text.replace(u'"', u"&quot;")
      return text
docs: r"""
      Encodes `text` for raw use in HTML.
      
          >>> htmlquote(u"<'&\">")
          u'&lt;&#39;&amp;&quot;&gt;'