From fd49b2addc85e2e5b3bf060ccef21ed66a8c3224 Mon Sep 17 00:00:00 2001 From: Ekaterina Date: Mon, 1 Jul 2019 16:19:06 +0300 Subject: [PATCH] Add escape filter for descriptions --- Web-documentation/all_contents.html.twig | 2 +- Web-documentation/blocks/class-body.html.twig | 2 +- Web-documentation/blocks/enum-body.html.twig | 4 +- Web-documentation/blocks/field-row.html.twig | 2 +- .../blocks/method-body.html.twig | 6 +- .../blocks/versioning-info.html.twig | 2 +- Web-documentation/errors.html.twig | 86 +++++++++---------- 7 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Web-documentation/all_contents.html.twig b/Web-documentation/all_contents.html.twig index 05e171c..f65fd02 100644 --- a/Web-documentation/all_contents.html.twig +++ b/Web-documentation/all_contents.html.twig @@ -110,7 +110,7 @@

{{ methodGroup.title }}

{% if methodGroup.description is not null %} -

{{ methodGroup.description }}

+

{{ methodGroup.description | escape }}

{% endif %} {% if methodGroup.baseUrl is not empty %}

BaseUrl: {{ methodGroup.baseUrl }}

diff --git a/Web-documentation/blocks/class-body.html.twig b/Web-documentation/blocks/class-body.html.twig index 5406880..832ad62 100644 --- a/Web-documentation/blocks/class-body.html.twig +++ b/Web-documentation/blocks/class-body.html.twig @@ -1,7 +1,7 @@

{{ structure.type.baseTypeName }}

Описание

-

{{ structure.description }}

+

{{ structure.description | escape }}

Структура данных

diff --git a/Web-documentation/blocks/enum-body.html.twig b/Web-documentation/blocks/enum-body.html.twig index 746771c..9df2c68 100644 --- a/Web-documentation/blocks/enum-body.html.twig +++ b/Web-documentation/blocks/enum-body.html.twig @@ -1,7 +1,7 @@

{{ structure.name }}

Описание

-

{{ structure.description }}

+

{{ structure.description | escape }}

Возможные значения

@@ -13,7 +13,7 @@ {% for value in structure.values %}
{{ value.value }}
-
{{ value.description }}
+
{{ value.description | escape }}
{% endfor %}
diff --git a/Web-documentation/blocks/field-row.html.twig b/Web-documentation/blocks/field-row.html.twig index 99f8510..4bbfe77 100644 --- a/Web-documentation/blocks/field-row.html.twig +++ b/Web-documentation/blocks/field-row.html.twig @@ -46,6 +46,6 @@  ({{ field.type.dateFormat }}) {%- endif -%}
-
{{ field.description }}
+
{{ field.description | escape }}
{{ utils.optionalDescription(field.optional) }}
\ No newline at end of file diff --git a/Web-documentation/blocks/method-body.html.twig b/Web-documentation/blocks/method-body.html.twig index 056014f..14bc9df 100644 --- a/Web-documentation/blocks/method-body.html.twig +++ b/Web-documentation/blocks/method-body.html.twig @@ -1,4 +1,4 @@ -

{{ method.description }}

+

{{ method.description | escape }}

Метод

{{ method.type }} {{ method.url }}

@@ -120,7 +120,7 @@ {% else %} {% for value in method.errorsEnumeration.values -%} {%- if value.value in method.errorsEnumeration.allowedValues %} -

#Код {{ value.value }} — {{ value.description }}

+

#Код {{ value.value }} — {{ value.description | escape }}

{%- endif -%} {%- endfor %} {% endif %} @@ -130,7 +130,7 @@

Результат отсутствует

{% else %} {% if method.booleanResponseDescription is not empty %} -

{{ method.booleanResponseDescription }}. Тип Boolean.

+

{{ method.booleanResponseDescription | escape }}. Тип Boolean.

{% elseif method.responseFields is not empty %}

Объект следующей структуры:

diff --git a/Web-documentation/blocks/versioning-info.html.twig b/Web-documentation/blocks/versioning-info.html.twig index 7c8b120..19ef101 100644 --- a/Web-documentation/blocks/versioning-info.html.twig +++ b/Web-documentation/blocks/versioning-info.html.twig @@ -19,7 +19,7 @@ { "result": null "error_code": {{ outOfDateError.value }}, - "error_message": "{{ outOfDateError.description }}" + "error_message": "{{ outOfDateError.description | escape }}" } diff --git a/Web-documentation/errors.html.twig b/Web-documentation/errors.html.twig index 87aa8ff..1929bc0 100644 --- a/Web-documentation/errors.html.twig +++ b/Web-documentation/errors.html.twig @@ -1,44 +1,44 @@ -{%- include 'blocks/head.html.twig' with { title: pageTitle, cssFolderPath: cssFolderPath } %} - -
-
-
- {%- include 'blocks/menu-header.html.twig' %} -
-
- {%- include 'blocks/main-menu.html.twig' with { mainMenu: mainMenu } %} -
-
-
- -
- {%- include 'blocks/header.html.twig' with { - imagesFolderPath: imagesFolderPath, - methodsPath: methodsPath, - relativeToRootPath: relativeToRootPath - } %} - -
-
-
-
-
-
Код ошибки
-
Текстовое описание ошибки
-
- {% for errorValue in errorType.values %} -
-
{{ errorValue.value }}
-
{{ errorValue.description }}
-
- {% endfor %} -
-
-
-
-
- -{%- include 'blocks/scripts.html.twig' with { jsFolderPath: jsFolderPath } %} - - +{%- include 'blocks/head.html.twig' with { title: pageTitle, cssFolderPath: cssFolderPath } %} + +
+
+
+ {%- include 'blocks/menu-header.html.twig' %} +
+
+ {%- include 'blocks/main-menu.html.twig' with { mainMenu: mainMenu } %} +
+
+
+ +
+ {%- include 'blocks/header.html.twig' with { + imagesFolderPath: imagesFolderPath, + methodsPath: methodsPath, + relativeToRootPath: relativeToRootPath + } %} + +
+
+
+
+
+
Код ошибки
+
Текстовое описание ошибки
+
+ {% for errorValue in errorType.values %} +
+
{{ errorValue.value }}
+
{{ errorValue.description | escape }}
+
+ {% endfor %} +
+
+
+
+
+ +{%- include 'blocks/scripts.html.twig' with { jsFolderPath: jsFolderPath } %} + + \ No newline at end of file