docs: def _wrap_ele(self, block, view, frag, extra_data=None):
          """
          Does the guts of the wrapping the same way for both xblocks and asides. Their
          wrappers provide other info in extra_data which gets put into the dom data- attrs.
          """
          wrapped = Fragment()
          data = {
              'usage': block.scope_ids.usage_id,
              'block-type': block.scope_ids.block_type,
          }
          data.update(extra_data)
  
          if frag.js_init_fn:
              data['init'] = frag.js_init_fn
              data['runtime-version'] = frag.js_init_version
  
          json_init = ""
          # TODO/Note: We eventually want to remove: hasattr(frag, 'json_init_args')
          # However, I'd like to maintain backwards-compatibility with older XBlock
          # for at least a little while so as not to adversely effect developers.
          # pmitros/Jun 28, 2014.
          if hasattr(frag, 'json_init_args') and frag.json_init_args is not None:
              json_init = (
                  '<script type="json/xblock-args" class="xblock_json_init_args">'
                  '{data}</script>'
              ).format(data=json.dumps(frag.json_init_args))
  
          block_css_entrypoint = block.entry_point.replace('.', '-')
          css_classes = [
              block_css_entrypoint,
              '{}-{}'.format(block_css_entrypoint, view),
          ]
  
          html = "<div class='{}'{properties}>{body}{js}</div>".format(
              markupsafe.escape(' '.join(css_classes)),
              properties="".join(" data-%s='%s'" % item for item in list(data.items())),
              body=frag.body_html(),
              js=json_init)
  
          wrapped.add_content(html)
          wrapped.add_fragment_resources(frag)
          return wrapped