Преглед на файлове

Strip HTML tags and escape special characters in <meta>. Fixes frappe/erpnext_com#53

version-14
Anand Doshi преди 10 години
родител
ревизия
89e95cd6b1
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. +1
    -1
      frappe/templates/includes/meta_block.html
  2. +1
    -1
      frappe/website/doctype/web_page/web_page.py

+ 1
- 1
frappe/templates/includes/meta_block.html Целия файл

@@ -1,5 +1,5 @@
{%- if metatags -%} {%- if metatags -%}
{%- for name in metatags %} {%- for name in metatags %}
<meta name="{{ name }}" content="{{ metatags[name]|striptags }}" data-html-block="meta_block">
<meta name="{{ name }}" content="{{ metatags[name]|striptags|escape }}" data-html-block="meta_block">
{%- endfor -%} {%- endfor -%}
{%- endif -%} {%- endif -%}

+ 1
- 1
frappe/website/doctype/web_page/web_page.py Целия файл

@@ -146,7 +146,7 @@ class WebPage(WebsiteGenerator):
def set_metatags(self, context): def set_metatags(self, context):
context.metatags = { context.metatags = {
"name": context.title, "name": context.title,
"description": context.description or strip_html((context.main_section or "").replace("\n", " "))[:500]
"description": (context.description or context.main_section or "").replace("\n", " ")[:500]
} }


image = find_first_image(context.main_section or "") image = find_first_image(context.main_section or "")


Зареждане…
Отказ
Запис