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

Partials used with object of partials removes space #826

Open
ToddJ101 opened this issue Nov 21, 2023 · 0 comments
Open

Partials used with object of partials removes space #826

ToddJ101 opened this issue Nov 21, 2023 · 0 comments

Comments

@ToddJ101
Copy link

Issue description:
Between the versions 3.0.1 and 3.0.2-4.2.0 a change was introduced that affects templates that only have spaces and an object of partials. Previous template output respected the space in the template string, behavior of v3.0.2, and after removes the space in the template string between replaced object partials.

Expected Behavior
When I use the third parameter of .render(template, {}, partials) sending in an object of partials. The template with only spaces between the partials should keep my template string spaces between partial nodes.

Code Example:
const template = '{{> Container1}} {{> Container2}} {{> Container3}}'

// The partial I am using
const partials = {
Container1: 'Container1',
Container2: 'Container2',
Container3: 'Container3'
}

// THE MUSTACHE CALL
const newValues = mustache.render(template, {}, partials)

// 3.0.1 OUTPUT of newValues:
console.log(newValues) // Container1 Container2 Container3

// 3.0.2-4.2.0 OUTPUT of newValues:
console.log(newValues) // Container1Container2Container3

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

1 participant