Skip to content

Commit

Permalink
[BUGFIX] Use additional v-pre tags to avoid issues with user input. #498
Browse files Browse the repository at this point in the history
  • Loading branch information
kfdm authored Apr 22, 2024
2 parents 69ba806 + 63976fe commit 2e0f062
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions promgen/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"rest_framework",
"social_django",
# Django
"django.forms",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
Expand Down Expand Up @@ -116,6 +117,7 @@
},
},
]
FORM_RENDERER = "django.forms.renderers.TemplatesSetting"

WSGI_APPLICATION = "promgen.wsgi.application"

Expand Down
2 changes: 2 additions & 0 deletions promgen/templates/django/forms/widgets/textarea.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<textarea v-pre name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>
{% if widget.value %}{{ widget.value }}{% endif %}</textarea>
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

{% if project.description %}

<div class="panel-body">
<div v-pre class="panel-body">
{{project.description|linebreaksbr|urlize}}
</div>

Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/rule_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>Rule: {{ rule.name }}</h1>
{% if rule.description %}
<div>
<label>Description:</label>
<p>{{rule.description}}</p>
<p v-pre>{{rule.description}}</p>
</div>
{% endif %}
<pre v-pre>{{rule|rule_dict|pretty_yaml}}</pre>
Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/service_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

{% if service.description %}
<div class="panel panel-default">
<div class="panel-body">
<div v-pre class="panel-body">
{{service.description|linebreaksbr|urlize}}
</div>
</div>
Expand Down

0 comments on commit 2e0f062

Please sign in to comment.