Skip to content

[BUGFIX] Prevent Twig from swallowing whitespace between inline tags #931

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{{- node.value -}}
{%- if node.value == ' ' -%}
{{ ' '|raw }}
{%- else -%}
{{ node.value }}
{%- endif -%}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>
<span class="classifier"><code>classifier</code></span>
</dt>
<dd>Definition 1</dd>
<dt><strong>Complex:</strong> <code>int</code></dt>
<dt><strong>Complex:</strong>&#32;<code>int</code></dt>
<dd>Colon must be surrounded by spaces to be a term identifier</dd>
<dt>multi-line definition term</dt>
<dd>
Expand Down
13 changes: 13 additions & 0 deletions tests/Integration/tests/inline-combinations/expected/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- content start -->
<div class="section" id="document-title">
<a id="start"></a>
<h1>Document Title</h1>

<p>Lorem Ipsum Dolor.</p>
<p><strong>all</strong>&#32;<a href="/index.html#start">data</a></p>
<p><em>all</em>&#32;<a href="/index.html#start">data</a></p>
<p><strong>bold</strong> and <em>italic</em></p>
<p><strong>bold</strong>&#32;<em>italic</em></p>
</div>

<!-- content end -->
15 changes: 15 additions & 0 deletions tests/Integration/tests/inline-combinations/input/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. _start:

==============
Document Title
==============

Lorem Ipsum Dolor.

**all** :ref:`data <start>`

*all* :ref:`data <start>`

**bold** and *italic*

**bold** *italic*
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>table</title>

</head>
<body>
<!-- content start -->
<div class="section" id="table">
<h1>table</h1>
Expand Down Expand Up @@ -71,5 +64,3 @@ <h1>table</h1>
</div>

<!-- content end -->
</body>
</html>