Overrides elements with bad content #107

Closed
mmalecki opened this Issue May 10, 2013 · 2 comments

Projects

None yet

2 participants

@mmalecki

With template:

<div>
  <div class="page-details">
    <div class="author">
      <div class="name"></div>
    </div>
  </div>
  <div class="page-details">
    <h1 class="title"></h1>
  </div>
</div>

Data:

{
  "page-details": {
    "author": {
      "name": "Maciej"
    },
    "title": "Title"
  }
}

Output should be:

<div>
  <div class="page-details">
    <div class="author">
      <div class="name">Maciej</div>
    </div>
  </div>
  <div class="page-details">
    <h1 class="title">Title</h1>
  </div>
</div>

But is:

<div>
  <div class="page-details">
    <div class="author">
      <div class="name">Maciej</div>
    </div>
  </div>
  <div class="page-details">
    <div class="author">
      <div class="name">Maciej</div>
    </div>
  </div>
</div>
@mmalecki

Apparently the reason it happens is because we do a replace() on body, but get the replacement value only once.

@Swaagie
Member
Swaagie commented May 24, 2013

This is caused by both page-details being a div, probably a regexp that is malfunctioning somewhere, hope to fix this today. Test 36 shows this can be done properly already

@3rd-Eden 3rd-Eden closed this in 60c8471 May 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment