spullara / spullara/mustache.java

Indentation of partials according to spec

Open
#211 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
2k
Forks
281
PR merge metrics
No merged PRs in 30d

Description

Hi,

I noticed that the following testcase of the mustache spec is not rendered correctly (the partial is not indented):

  - name: Standalone Indentation
    desc: Each line of the partial should be indented before rendering.
    data: { content: "<\n->" }
    template: |
      \
       {{>partial}}
      /
    partials:
      partial: |
        |
        {{{content}}}
        |
    expected: |
      \
       |
       <
      ->
       |
      /

The current outcome is:

\
 |
<
->
|

/

I am using mustache templating for markdown templates where whitespace does matter, so this is a real problem for me.

I saw that the readme states Passes all of the mustache specification tests modulo whitespace differences. Is this on purpose or would a PR that tries to fix this difference from the spec be welcome?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the linked Mustache specification testcase with the current rendering behavior, using the issue's template and partial as the reproduction. The work is done when each line of the partial is indented as shown in the specification's expected output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.