Blank line added in if merge command

IF merge commands (perhaps other merge commands too) result in a blank line being added after the output. An example command:

<?if =$value$= > 10 ?>
Value is greater than 10
<?else?>
Value is less than (or equal to) 10
<?endif?>

For a value of 11 this would output:

Value is greater than 10

This won’t cause an issue in many use cases but it might in others. Would be great if the result of the merge did not add any superfluous lines.

I’ll add this to the list and look into it.

Thanks.

1 Like

I’m not able to reproduce this.

Here’s my test code in the template.

<?set count = 5 ?>
<p>Line before if test.</p>
<?if =$count$= gt 10 ?>
=$count$= greater than ten
<?else?>
=$count$= not greater than ten
<?endif?>
<p>Line after if test.</p>

And here’s the resulting output.

<p>Line before if test.</p>
5 not greater than ten
<p>Line after if test.</p>

Interesting. Indeed that example works for me too.

I think it must be the content that is injected that is adding the additional lines line. e.g. if my variable is a markdown unordered list then in the template where i convert that to html the closing </ul> is always followed by a blank line. I’ll try and do some further tests when i get a chance.

Some additional information…I switched the Markdown Parser to Ink and the html output was without additional lines. Both Down and Mkdown did have the additional lines.

Again, this isn’t a big deal. I just like to have as much control as possible over what is being outputted :slight_smile:

Was just looking at the knowledge base to get a bit more info about the 3 different parsers but it seems something is broken with that page/link:


Have to say the knowledge base is exceptional - both the content and the fact that it is built using Notenik.

Hey, I’m wondering if you might have still had Down or Ink set as your Markdown parser when you were looking at that page? It seems to work ok for me when using the Notenik parser. (The other two parsers don’t recognize the wiki link syntax.)

1 Like

BTW, glad you like the knowledge base! It helps to keep me sane, both in making sure that Notenik does everything it’s supposed to do, and also keeping track of what exactly it is supposed to do.

1 Like

I had changed it back to the Notenik parser but it seems that the collection needed a refresh / reload for it to resolve itself.

1 Like