Skip to content
Snippets Groups Projects
Commit 4bbc5f0a authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Avoid extra whitespace in copied clipboard text

This is because of the positioning of the elements which triggers
a clipboard.js bug: zenorocha/clipboard.js#382
Removing the whitespace around the HTML tags works around this issue.

closes: #1041
parent db41f0c8
No related branches found
No related tags found
No related merge requests found
...@@ -28,19 +28,20 @@ ...@@ -28,19 +28,20 @@
<br> <br>
<h2>{{ 'Converted metadata'|trans }}</h2> <h2>{{ 'Converted metadata'|trans }}</h2>
{% for type, text in output if text -%} {% for type, text in output if text -%}
{# spaceless is to work around a clipboard.js bug that would add extra whitespace #}
{% spaceless %}
<div class="code-box"> <div class="code-box">
<div class="code-box-title"> <div class="code-box-title">
<h3> {{ type }}</h3> <h3>{{ type }}</h3>
<button data-clipboard-target="#metadata{{ loop.index }}" id="btn{{ loop.index }}" class="pure-button right clipboard-btn copy"> <button data-clipboard-target="#metadata{{ loop.index }}" id="btn{{ loop.index }}" class="pure-button right clipboard-btn copy">
<i class="fa fa-copy"></i> <i class="fa fa-copy"></i>
</button> </button>
</div> </div>
<div class="code-box-content"> <div class="code-box-content">
<pre id="metadata{{ loop.index }}"> <pre id="metadata{{ loop.index }}">{{ text|escape }}</pre>
{%- spaceless %}{{ text|escape }}{% endspaceless -%}
</pre>
</div> </div>
</div> </div>
{% endspaceless %}
<br><br> <br><br>
{%- set i=i+1 %} {%- set i=i+1 %}
{%- endfor -%} {%- endfor -%}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment