class_docstr: Builder that outputs epub files.
  
  It creates the metainfo files container.opf, toc.ncx, mimetype, and
  META-INF/container.xml.  Afterwards, all necessary files are zipped to an
  epub file.
class_docstr_tok: ["Builder","that","outputs","epub","files",".","It","creates","the","metainfo","files","container.opf",",","toc.ncx",",","mimetype",",","and","META-INF\/container.xml",".","Afterwards",",","all","necessary","files","are","zipped","to","an","epub","file","."]
docstr: Replace colons with hyphens in href and id attributes.
  
  Some readers crash because they interpret the part as a
  transport protocol specification.
code: def fix_ids(self, tree: nodes.document) -> None:
      """Replace colons with hyphens in href and id attributes.
  
      Some readers crash because they interpret the part as a
      transport protocol specification.
      """
  
      def update_node_id(node: Element) -> None:
          """Update IDs of given *node*."""
          new_ids: list[str] = []
          for node_id in node["ids"]:
              new_id = self.fix_fragment("", node_id)
              if new_id not in new_ids:
                  new_ids.append(new_id)
          node["ids"] = new_ids
  
      for reference in tree.findall(nodes.reference):
          if "refuri" in reference:
              m = self.refuri_re.match(reference["refuri"])
              if m:
                  reference["refuri"] = self.fix_fragment(
                      m.group(1), m.group(2)
                  )
          if "refid" in reference:
              reference["refid"] = self.fix_fragment(
                  "", reference["refid"]
              )
  
      for target in tree.findall(nodes.target):
          update_node_id(target)
  
          next_node: Node = target.next_node(ascend=True)
          if isinstance(next_node, nodes.Element):
              update_node_id(next_node)
  
      for desc_signature in tree.findall(addnodes.desc_signature):
          update_node_id(desc_signature)
  
imports: from __future__ import annotations
  import html
  import os
  import re
  import time
  from os import path
  from typing import TYPE_CHECKING, Any, NamedTuple
  from urllib.parse import quote
  from zipfile import ZIP_DEFLATED, ZIP_STORED, ZipFile
  from docutils import nodes
  from docutils.utils import smartquotes
  from sphinx import addnodes
  from sphinx.builders.html import BuildInfo, StandaloneHTMLBuilder
  from sphinx.locale import __
  from sphinx.util import logging
  from sphinx.util.display import status_iterator
  from sphinx.util.fileutil import copy_asset_file
  from sphinx.util.osutil import copyfile, ensuredir, relpath
label_desc: Use image node_id 10 for calling the EpubBuilder obj's underlying member method code with example usage: obj.fix_ids(tree) without return types