docs: def render_select2_options_code(self, options, id_):
          """Render options for select2."""
          output = []
          for key, value in options.items():
              if isinstance(value, (dict, list)):
                  value = json.dumps(value)
              output.append("data-{name}='{value}'".format(
                      name=key,
                      value=mark_safe(value)))
          return mark_safe(' '.join(output))