janl / mustache.js

Minimal templating with {{mustaches}} in JavaScript
https://mustache.github.io
MIT License
16.47k stars 2.39k forks source link

Unwanted character limit when outputting HTML #326

Closed robbymarston closed 9 years ago

robbymarston commented 11 years ago

I'm outputting HTML using triple curly-brackets and it seems to stop rendering half way through my code. I've checked the source and there's no illegal character or any other red flags at the break point. The content is for a parenting website, here it is:

<p align="center"><b>Introduction</b></p>
<b>Postpartum support groups</b> <b> </b> My interest in the postnatal period began when I became a certified childbirth educator back in 1978. With my background in psychology, I always felt curious about how women adjust to becoming mothers from a psychological perspective, and this led me to create a postpartum support group.
<ul>
  <li>I called it And Baby Makes 3.</li>
  <li>This was a group for new mothers who came together to share their experiences, both positive and negative, and to learn from each other.</li>
  <li>An unspoken aspect of this group experience was the sense of community it created, bringing women who were at the same stage in life into a supportive network with each other.
    <ul>
      <li>In those days networking happened on a face to face basis!</li>
    </ul>
  </li>
</ul>
&nbsp;

On a personal level, I had two young children at the time, and after the birth of my second son I experienced a subclinical case of postpartum depression – not enough to disable me, but enough to not feel right for a number of months.
<ul>
  <li>Had there been a group for me where I could have expressed my feelings, I think it would have provided a very healing framework to work through the issues I was having.</li>
  <li>It was when I joined a women's group (the consciousness-raising kind of that era) that I realized that I had been suffering a mild depression and the support of other women was instrumental in helping me return to my normal self.</li>
</ul>
&nbsp;

Another inspiration for this group was a book that had just been published called <i>Mothercare</i>, by Lyn DelliQuadri and Kati Breckenridge, which advocated for supporting women through this important transition into parenthood.
<ul>
  <li>Posting flyers on notice boards attracted the attention of a talk radio reporter, who interviewed me about the group I was creating.</li>
  <li>Lyn DelliQuadri contacted me at this time, when she was producing a video based on the book, and she was looking for potential 'actors' to film.
    <ul>
      <li>In principle I liked the idea, but in practical reality the presence of a film crew in the home at this vulnerable time in a woman's life was not popular.</li>
      <li>I didn't recruit for her film and we lost touch so I don't know what happened with it, but I felt even more resolved about the importance of supporting mothers through this time.</li>
    </ul>
  </li>
</ul>
&nbsp;

After our family moved back to New York in 1980, I was soon pregnant with my daughter and was learning the lay of the land as both a pregnant woman and a childbirth educator.
<ul>
  <li>I was networking with maternity care providers, other childbirth educators, and mothers to get a sense of the resources that were available to women/mothers at that time.</li>
  <li>Planning a home birth connected me with the underground movement of alternative birth choices in order to locate a home birth midwife in the area.</li>
  <li>After starting with midwives who worked and lived in New York City, when we lived in the northern suburbs (and one of them did not drive), I decided to change midwife.
    <ul>
      <li>The choice was based on a new friend's experience of having to send someone to collect the midwife when she went into labor.
        <ul>
          <li>I knew that wouldn't work for me.</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Since home birth midwives were few and far between in those days, I ended up with a midwife who worked in another adjacent county and lived in northern New Jersey.
    <ul>
      <li>I found out about her from women at a La Leche League meeting that I had been attending.</li>
      <li>La Leche League (LLL) is the grassroots organization that was created in the late 1950s by women who were looking for information and support while breastfeeding, and has grown into an international presence around the world for all kinds of breastfeeding knowledge and expert advice (LLLI).</li>
      <li>Although many women like me attended meetings before birth, most of the women who attended were new mothers going through the trials and tribulations of the postnatal period and benefitting by the breastfeeding support.</li>
      <li>It was one of the few postnatal group experiences that were available at the time.</li>
    </ul>
  </li>
</ul>
&nbsp;

However, I had attended league meetings both in California and New York and was troubled by the attitude that good mothers must breastfeed to the exclusion of all else, and that it was not compatible with going back to work.
<ul>
  <li>Even positive stories of mothers who had gone back to work and successfully continued to breastfeed, or someone who had taken a short holiday break which did not disrupt the nursing experience with her child, were scorned by the leaders as 'bad mothering'.
    <ul>
      <li>Nursing mothers should not work or leave their babies behind in the care of others, even though in both circumstances the women had managed to continue breastfeeding.</li>
      <li>I was incredulous that the success was not recognized in a positive way.
        <ul>
          <li>The near religious fervor of those beliefs made me determined to provide a 'non-sectarian' group experience for new mothers.</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Since then, La Leche League has evolved and even published a book acknowledging women who work and want to continue to breastfeed.
    <ul>
      <li>It was a long time coming and it was the reason that I stopped attending meetings.</li>
      <li>I would like to acknowledge, however, that the information that LLLI provides on the subject is excellent, and the breastfeeding support that they offer by telephone to struggling mothers is second to none.</li>
    </ul>
  </li>
</ul>
<b>Postpartum exercise classes</b> <b> </b> After my daughter was born I was looking for something to do with her while my sons were at school.
<ul>
  <li>I ran a couple of groups and found that what mothers were most concerned about was getting back into shape and finding something they could do with their babies, and Reshape and Unwind was born.</li>
  <li>This was a postpartum exercise class for mothers and babies that included infant exercise and baby massage instruction.
    <ul>
      <li>I had attended classes like this when my sons were little in New York City with Suzy Prudden, the only person I knew that taught mother and baby classes, and I modelled my classes on her work.
        <ul>
          <li>Suzy was a fitness guru at the time and an exercise inspiration for me.</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>In the last year of living in California (we lived there from 1977-1980), I had been a regular attendee of Jane Fonda's Workout in Beverly Hills and had become a fitness enthusiast, which gave momentum to my decision to create an exercise class for mothers and babies.</li>
  <li>Another model that I used was the format set up by Femmy Delyser, who created the program for pregnant and postpartum women at Jane Fonda's Workout, and who I knew as a childbirth educator colleague.
    <ul>
      <li>Suzy inspired the activities for babies, and Femmy inspired the mothers' workout that I created to help them get back into shape.</li>
      <li>It was a synthesis of both with a focus on both mother and baby.</li>
    </ul>
  </li>
  <li>It ran for twenty years and finished after I immigrated to the UK and ran the class through a local leisure centre and then independently for a while.</li>
</ul>
&nbsp;

A by-product of these classes was the community that was created for mothers who continued to meet with each other long after they finished the course with me.
<ul>
  <li>I would bump into women in the community who told me that they were still friends with women they had met in my classes ten years before.
    <ul>
      <li>And their children were friends too!</li>
      <li>When I was promoting these classes to the local pediatricians, the sympathetic comments they made acknowledged how these classes would provide the kind of experience that women living in cities would find at the park bench.</li>
      <li>Women of the suburbs often felt isolated in their homes, not having a place to gather with other mothers, and what I was doing was filling a gap.</li>
      <li>The doctors were supportive of my efforts and the classes were popular with mothers, and the benefit for me was my own personal fitness over twenty years.</li>
      <li>I listened to mothers' concerns and provided an oasis for new mothers to express their deepest issues and share their wisdom with others in a beautiful exchange of caring support for each other.
        <ul>
          <li>That is truly the essence of community, and I am delighted that I have contributed to that by facilitating these offerings for new mothers in various locations.</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
&nbsp;

I also worked over the years as a doula, the Greek word for servant, who mothers the mother during labor and the postpartum period.
<ul>
  <li>Being a birth doula was something I had done with my clients going back to 1978, and I attended births in California and New York in birth centers and hospitals.
    <ul>
      <li>Channeling birth energy was something that I was particularly good at.</li>
      <li>On occasion I also functioned as a postnatal doula, going into the home and doing various housekeeping tasks that would allow the mother to focus her attention on the baby and the relationship that was developing between her and her newborn.</li>
      <li>It was in 1995 that I created a doula service for birth and the postpartum period afterwards.
        <ul>
          <li>The majority of my clients were women who were childbirth preparation clients, but I was also listed in various resources for doula care in which I worked with women who did not know me in that context.</li>
          <li>Many of my postnatal doula clients started as strangers, but I loved serving women in that capacity, and we bonded in the days when I was visiting them in their homes.
            <ul>
              <li>It was great to be able to open a space for them to integrate their new baby into their lives in a healthy and positive way.</li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
<b>Continued professional development</b> While I was teaching Reshape and Unwind, I went back to graduate school to get my Master's Degree in Applied Psychology, with a specialty in The Psychology of Parenthood.
<ul>
  <li>Working with mothers over the years had inspired me to take it to a new level in studying the subject in an academic context.</li>
  <li>When I conducted research into new motherhood I was able to use the classes as a source of subjects and as a context for studying mothers.</li>
  <li>The everyday experience of working with mothers and studying parenthood dovetailed nicely culminating in an MA in 1994.
    <ul>
      <li>I loved watching women mature into their motherhood, connected to their babies and to others through the context of an exercise class.</li>
      <li>My studies enriched my awareness of the transition to parenthood from an intellectual perspective, which were translated into my interactions with my clients.</li>
      <li>As I grew in knowledge and wisdom I shared this with women, always striving to provide the best experience that would facilitate this transition for them, with a specific focus on the early months after giving birth.</li>
      <li>My expertise was grounded in my work with mothers and the education that provided the theory that informed that work.</li>
    </ul>
  </li>
</ul>
&nbsp;

When I immigrated to the UK, I again became a postgraduate student studying for my PhD in Women's Studies.
<ul>
  <li>The feminist research that I conducted used my case notes as a certified childbirth educator as the data for analysis in my thesis (The Childbirth Educator as Ethnographer: A Feminist Retrospective Ethnography of a Professional Practice, University of Manchester, 2002).</li>
  <li>The reflective reading that informed my thesis uncovered certain themes in the accounts of birth that my birth clients had told me over the ten years that were the focus of this research.
    <ul>
      <li>They were knowledge, support and empowerment, or knowledge + support=empowerment.</li>
      <li>The research strengthened my feminist awareness and applied it to the work that I had done with both pregnant and postnatal women over the years.</li>
      <li>I was looking at the transition to parenthood with a feminist lens and noticing the gap in feminism when it came to birth and becoming a mother.</li>
      <li>I wrote an article called “Becoming a Mother” in the Journal for the Association for Research on Mothering (ARM) that was published in 2001.
        <ul>
          <li>The article concentrated on the number of choices a woman has to consider on her journey to becoming a mother in a society where mothering seems to be an imperative role for women.</li>
          <li>The feminist focus on reproductive rights was more about if and when to have children and the attitude towards mothering was constrained due to the emphasis on women's place in the marketplace.</li>
          <li>Childbirth was far too biologically deterministic for feminism to embrace during the Third Wave.</li>
          <li>That birth could be an empowering experience, particularly with knowledge and support, was my contribution to the literature.</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
&nbsp;

My first job as an academic researcher was on a randomized controlled trial (RCT, the so-called gold standard for health research) on postnatal depression.
<ul>
  <li>In the UK there is a nursing specialty called a health visitor, who does additional training for this position, and whose role is to facilitate the transition to parenthood by visiting the mother in her home for a number of weeks after the midwife signs off.</li>
  <li>I was a local research coordinator working with health visitors attached to general practices that were part of the study comparing the effectiveness of different counseling approaches to postnatal depression.
    <ul>
      <li>Health visitors were trained in either person-centered counseling or cognitive behavioral counseling prior to the onset of the study, and they counseled women who had postnatal depression using one of these techniques.</li>
      <li>I travelled around the area visiting health visitors and helping to recruit participants for a year and a half, and then started on another study on postnatal health which I did concurrently for another nine months.</li>
      <li>The measure of postnatal depression that was used was the EPDS, or the Edinburgh Postnatal Depression Scale, and those women in the study who scored above the threshold were offered the counseling.
        <ul>
          <li>The RCT continued for another couple of years after I left the project to focus my attention on health rather than depression.</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
&nbsp;

This study developed an instrument that would measure postnatal health and I was happy to be working on something positive around new parenthood.
<ul>
  <li>So much theory about the transition is based on pathology in the same way that health is sometimes defined as the absence of disease.</li>
  <li>I was the qualitative researcher on this project and interviewed 52 participants, both mothers and fathers, to get a sense of what their experience was like in the weeks following their babies' births.
    <ul>
      <li>What were the challenges and what were the healthy aspects of this period in their lives?</li>
      <li>The analysis of the data generated items for the Sheffield Postnatal Health Instrument, which was mailed to more than a thousand women and their partners, and measured various elements of life in the early days.
        <ul>
          <li>My contract on this study finished before the final instrument was fine-tuned, and the first article to come out of the research was published in 2011 in the Quality of Life Journal.</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
&nbsp;

My 'career' as a health researcher took me further and further away from birth and the postnatal period with the next projects that I worked on, and after seven years of academic research I made the decision to return to the work I felt passionate about – birth and the postnatal period.
<ul>
  <li>When my last contract ended, I left academia to become self-employed again as a workshop facilitator and mentor for the childbearing year.</li>
  <li>I resumed the provision of doula care and have become a recognized birth doula in the UK after taking a training course and being fast tracked through the recognition process with Doula UK.</li>
  <li>An inspiration for this return to the work I love was the birth of my step-granddaughter in 2009.
    <ul>
      <li>I taught birth preparation classes to her parents and was the doula during her birth, which reawakened the impulse to engage with families again at this precious moment in life.</li>
      <li>In 2011 my daughter gave birth to my grandson in Los Angeles, and I was able to be with her when he was six days old for a couple of weeks and again for another couple of weeks the following month.</li>
      <li>Being a doula for my own grandchild was wonderful (my first granddaughter was born in 2005 and I also spent a few days with her in the early weeks) and my connection with my daughter blossomed too.</li>
      <li>Her experience of the postnatal period gave momentum to the decision to write this book and we've been able to incorporate her perceptions and struggles into the content of this handbook.</li>
      <li>She is the co-creator of this app, Digital Doula<sup>®</sup>, and we are so excited to be collaborating on this project together for the benefit of new mothers everywhere.</li>
    </ul>
  </li>
</ul>
<b>Is there life after birth?</b> <b> </b> I have often laughed with parents over this question because when they were preparing for childbirth they really could not see beyond the birth process.
<ul>
  <li>Nothing about the time after birth penetrates, because the birth looms so large.</li>
  <li>Then they felt lost once the birth was over because they didn't process the information that I gave them about the postpartum period, breastfeeding or baby care.</li>
  <li>When I restructured my Birth Empowerment Childbirth Preparation<sup>®</sup> classes I made the first class a Saturday workshop for women only for staying healthy during pregnancy, 4 classes on labor and delivery for couples, and then a Sunday seminar for couples about what happens after the baby is born; it was a chance to get hands on experience of changing a diaper/nappy and baby clothes on a doll and learn about other postpartum matters.</li>
  <li>Even before the structural change I encouraged people to take notes so they could refer to them later when needed.
    <ul>
      <li>In one class I had a couple of pregnant female obstetricians as clients who took copious amounts of notes about breastfeeding and other new parenting information that was not part of their knowledge base!
        <ul>
          <li>It was amusing to say the least.</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
&nbsp;

For this reason, <i>The Handbook for the Postnatal Period</i> has been written to accommodate this tendency to not hear anything about what happens after the birth.
<ul>
  <li>It can be taken to the birth place for ready reference immediately after birth; it can be used thereafter as something to reference on a particular subject, or to be read through to get an overall sense of what this special time in life is all about.</li>
  <li>It is designed to provide strategies for managing the intensity of change that is taking place and to increase your understanding of the dramatic fluctuations that occur with your hormones, your moods, and your energy levels.</li>
  <li>Knowledge is power and it is my hope that you will feel empowered by the suggestions made to help you make the most of this transition, because ultimately you will come to realize that<b> you </b>are the expert of your own life and your baby.
    <ul>
      <li>I would like to help you rely less on 'experts' (even though I am one!) and tune in to your latent intuition, and the information that is contained in this book is geared for that unfolding.</li>
      <li>I have organized the chapters to create a flow that will support you as you take one day at a time adjusting to an entirely new reality of life, whether this is your first child or another that expands your family.
        <ul>
          <li>I want you to believe in yourself and claim your power as a parent, and I hope you can find your sense of humor in the process!</li>
          <li>Most of all I want to help <b>you simplify the everyday experience</b> of new parenthood, so you can enjoy it more.</li>
          <li>Blessed be.</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

It breaks just after the sentence, "For this reason, The Handbook for the Postnatal Period has been written to accommodate this tendency to not hear anything about what happens after the birth."

The object looks something like this:

{items:[{description:"TEXT GOES HERE"}]}

and the HTML:

{{#items}}
<article>{{{description}}}</article>
{{/items}}

Any help is appreciate, this one's got me stumped! Thank you :)

iarovyi commented 11 years ago

Couldn't reproduce an issue. I've created working jsFiddle with your data: http://jsfiddle.net/shXMF/ I guess we need more details. How exactly do you use it?

bobthecow commented 11 years ago

Please verify that you're using the latest version of Mustache.js. That means not one that comes with icanhaz.js or the one on the Mustache website :)

iarovyi commented 11 years ago

In jsFiddle(http://jsfiddle.net/shXMF/) I've used mustache downloaded from here(git) - version 0.7.2 Also I've checked it with icanhaz.js and some other sources but I still can't reproduce it, have I missed something?

bobthecow commented 11 years ago

@iarovyi Sorry, my comment was for OP, not for you. It's all too common that people run into issues because they have a really outdated version of mustache.js :)

nicolaiskogheim commented 10 years ago

Close-a-lull-able?

dasilvacontin commented 9 years ago

I'll close this issue due to inactivity. If it's still relevant, leave a comment and I'll reopen.