docs: def apply_styles(self, html, styles):
          """Insert style information into the HTML string.
          """
          index = html.find('</head>')
          if index >= 0:
              return ''.join((html[:index], styles, html[index:]))
          return html