Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Mustache tags on new lines are replaced with empty space #77

Open
AdamEisfeld opened this issue Jan 17, 2021 · 2 comments
Open

Mustache tags on new lines are replaced with empty space #77

AdamEisfeld opened this issue Jan 17, 2021 · 2 comments

Comments

@AdamEisfeld
Copy link

First off, great library!

I might be missing some obvious syntax here, but given the following example:

{{#someOptionalValue}}
The value is {{someOptionalValue}}
{{/someOptionalValue}}

The output we get (assuming someOptionalValue is "Hello, World") is:


The value is Hello, World

Is there a way to modify the tags, such that the newlines before / after "The value is Hello, World" are removed? Eg:

The value is Hello, World

Currently it seems I can only achieve this by putting everything on one line:

{{#someOptionalValue}}The value is {{someOptionalValue}}{{/someOptionalValue}}

I have seem some references to Handlebars using a tilde to accomplish this, eg:

{{~#someOptionalValue~}}
The value is {{someOptionalValue}}
{{/someOptionalValue}}

But in attempting to do this with this repository's Mustache implementation, I get an error "Unmatched closing tag".

Thanks,

  • Adam
@groue
Copy link
Owner

groue commented Jan 20, 2021

Hello @AdamEisfeld,

GRMustache.swift is now maintained by @fumito-ito. Let's wait for his answer. Meanwhile, a pull request that adds the described behavior, while respecting the Mustache Spec will be gladly reviewed.

@levigroker
Copy link

I'm seeing this, or something similar, today... in 2023. Any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants