当前位置: 首页>>代码示例>>Python>>正文


Python html.strip_spaces_between_tags方法代码示例

本文整理汇总了Python中django.utils.html.strip_spaces_between_tags方法的典型用法代码示例。如果您正苦于以下问题:Python html.strip_spaces_between_tags方法的具体用法?Python html.strip_spaces_between_tags怎么用?Python html.strip_spaces_between_tags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.utils.html的用法示例。


在下文中一共展示了html.strip_spaces_between_tags方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: render

# 需要导入模块: from django.utils import html [as 别名]
# 或者: from django.utils.html import strip_spaces_between_tags [as 别名]
def render(self, context):
        from django.utils.html import strip_spaces_between_tags
        return strip_spaces_between_tags(self.nodelist.render(context).strip()) 
开发者ID:lanbing510,项目名称:GTDWeb,代码行数:5,代码来源:defaulttags.py

示例2: get_infowindow

# 需要导入模块: from django.utils import html [as 别名]
# 或者: from django.utils.html import strip_spaces_between_tags [as 别名]
def get_infowindow(self):
        if not self.infowindow or not settings.DJANGOCMS_GMAPS_INFOWINDOW_ENABLED:
            return ''

        rendered_infowindow = render_to_string(
            settings.DJANGOCMS_GMAPS_INFOWINDOW_TEMPLATE, {'location': self, })
        return {
            'content': strip_spaces_between_tags(rendered_infowindow.strip()),
            'maxWidth': settings.DJANGOCMS_GMAPS_INFOWINDOW_MAXWIDTH
        } 
开发者ID:mishbahr,项目名称:djangocms-gmaps,代码行数:12,代码来源:models.py

示例3: process_response

# 需要导入模块: from django.utils import html [as 别名]
# 或者: from django.utils.html import strip_spaces_between_tags [as 别名]
def process_response(self, request, response):
        if 'text/html' in response['Content-Type']:
            response.content = strip_spaces_between_tags(response.content)
        return response 
开发者ID:seanbell,项目名称:opensurfaces,代码行数:6,代码来源:middleware.py

示例4: clean

# 需要导入模块: from django.utils import html [as 别名]
# 或者: from django.utils.html import strip_spaces_between_tags [as 别名]
def clean(self, x):
        """Strip all HTML tags and useless spaces before counting the number of characters."""
        return len(strip_tags(strip_spaces_between_tags(x)).replace(" ", "")) 
开发者ID:openfun,项目名称:richie,代码行数:5,代码来源:validators.py

示例5: process_response

# 需要导入模块: from django.utils import html [as 别名]
# 或者: from django.utils.html import strip_spaces_between_tags [as 别名]
def process_response(self, request, response):
        if 'text/html' in response['Content-Type'] and settings.MINIFY_HTML:
            #response.content = strip_spaces_between_tags(response.content)
            response.content = RE_MULTISPACE.sub(" ", response.content)
            response.content = RE_MULTIBOTH.sub("\n", response.content)
            response.content = RE_NEWLINE.sub("\n", response.content)
        return response


# Forked from Django to allow me to HTTPS-only the staff session 
开发者ID:canvasnetworks,项目名称:canvas,代码行数:12,代码来源:middleware.py


注:本文中的django.utils.html.strip_spaces_between_tags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。