Move regex preparation into methods, use named subpatterns so the regex makes more sense. Fix the logic around eating newlines adjacent to tags. Update tests to reflect the changes.
16 lines
265 B
Plaintext
16 lines
265 B
Plaintext
<h1>{{header}}</h1>
|
|
{{#notEmpty}}
|
|
<ul>
|
|
{{#item}}
|
|
{{#current}}
|
|
<li><strong>{{name}}</strong></li>
|
|
{{/current}}
|
|
{{^current}}
|
|
<li><a href="{{url}}">{{name}}</a></li>
|
|
{{/current}}
|
|
{{/item}}
|
|
</ul>
|
|
{{/notEmpty}}
|
|
{{#isEmpty}}
|
|
<p>The list is empty.</p>
|
|
{{/isEmpty}} |