linkedin / linkedin/dustjs

Whitespace-collapsing in templates can lead to no space between a word and a field

Open
#442 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.9k
Forks
461
PR merge metrics
No merged PRs in 30d

Description

Using the following template:

{! :tabSize=2:indentSize=2:mode=html: !}
{! The form for help/about !}
<div id="help-box" style="padding:10px">
  <h1>Help / About</h1>
  <form id="help-form">
    <fieldset style="width:100%">
      <div class="formelt">
        <p>
          This is version {version} of the interface, with version
          {backend_version} of the <code>browselogs.pl</code> back-end.
        </p>
      </div>
      <div class="formelt">
        <input type="submit" name="close" value="Close" class="button" style="width:100%">
      </div>
    </fieldset>
  </form>
</div>

When rendered, there is no space between the word "version" and the filled-in value of the field {backend_version}. The collapsing of whitespace seems to have been a little too eager in this case.

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 rendering the HTML template shown in the issue and compare the output around {backend_version}. Trace the template whitespace-collapsing behavior, then verify that the rendered text retains the space between "version" and the substituted field value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.