# Path: contentious/api.py
# class ContentiousInterface(object):
#     def in_edit_mode(self, template_context):
#     def get_content_data(self, key, template_context):
#     def save_content_data(self, key, data, template_context):
#     def pre_render(self, tag_spec, meta):
# def get_api():
# 
# Path: contentious/constants.py
# SELF_CLOSING_HTML_TAGS = ['img', 'br', 'hr', 'meta']
# 
# TREAT_CONTENT_AS_HTML_TAGS = getattr(settings,
#     'CONTENTIOUS_TREAT_CONTENT_AS_HTML_TAGS', ['div', 'select', 'ul'])


import logging
import re
from django import template
from django.template import loader, TemplateSyntaxError
from django.utils.html import escape
from ..api import api
from ..constants import (
    SELF_CLOSING_HTML_TAGS,
    TREAT_CONTENT_AS_HTML_TAGS,
)
        final_attrs = {k: escape(v) for k, v in final_attrs.items()}
        #Now start to build our tag
        assert not (content and self.is_self_closing())

        tag_spec = {
            "tag_name": self.tag_name,
            "attrs": final_attrs,
            "content": content,
        }
        meta = {
            "context": context,
            "key": key,
            "editables": editables,
            "optionals": optionals,
            "extra": extra,
            "in_edit_mode": edit_mode,
            "data_was_provided": data_was_provided,
        }
        tag_spec = self._pre_render(tag_spec, meta)
        tag = {
            "tag_name": tag_spec['tag_name'],
            "attrs": " ".join('%s%s' % (k, '="%s"' % v if v else '') for k, v in tag_spec['attrs'].items()),
            "self_close": " />" if self.is_self_closing() else ">",
            "content": tag_spec['content'],
            "close": "" if self.is_self_closing() else "</%s>" % tag_spec['tag_name'],
        }
        return "<%(tag_name)s %(attrs)s%(self_close)s%(content)s%(close)s" % tag


    def is_self_closing(self):

# Path: contentious/api.py
# class ContentiousInterface(object):
#     def in_edit_mode(self, template_context):
#     def get_content_data(self, key, template_context):
#     def save_content_data(self, key, data, template_context):
#     def pre_render(self, tag_spec, meta):
# def get_api():
# 
# Path: contentious/constants.py
# SELF_CLOSING_HTML_TAGS = ['img', 'br', 'hr', 'meta']
# 
# TREAT_CONTENT_AS_HTML_TAGS = getattr(settings,
#     'CONTENTIOUS_TREAT_CONTENT_AS_HTML_TAGS', ['div', 'select', 'ul'])


# Path: contentious/templatetags/contentious.py
import logging
import re
from django import template
from django.template import loader, TemplateSyntaxError
from django.utils.html import escape
from ..api import api
from ..constants import (
    SELF_CLOSING_HTML_TAGS,
    TREAT_CONTENT_AS_HTML_TAGS,
)

        final_attrs = {k: escape(v) for k, v in final_attrs.items()}
        #Now start to build our tag
        assert not (content and self.is_self_closing())

        tag_spec = {
            "tag_name": self.tag_name,
            "attrs": final_attrs,
            "content": content,
        }
        meta = {
            "context": context,
            "key": key,
            "editables": editables,
            "optionals": optionals,
            "extra": extra,
            "in_edit_mode": edit_mode,
            "data_was_provided": data_was_provided,
        }
        tag_spec = self._pre_render(tag_spec, meta)
        tag = {
            "tag_name": tag_spec['tag_name'],
            "attrs": " ".join('%s%s' % (k, '="%s"' % v if v else '') for k, v in tag_spec['attrs'].items()),
            "self_close": " />" if self.is_self_closing() else ">",
            "content": tag_spec['content'],
            "close": "" if self.is_self_closing() else "</%s>" % tag_spec['tag_name'],
        }
        return "<%(tag_name)s %(attrs)s%(self_close)s%(content)s%(close)s" % tag


    def is_self_closing(self):

        return self.tag_name in SELF_CLOSING_HTML_TAGS