dimensi / xhtml2pug

11 stars 2 forks source link

Double quotes are being converted to single quotes, breaking multi-quote-type usage #15

Open geoidesic opened 2 years ago

geoidesic commented 2 years ago

This is being converted using your vue plugin. E.g.

          <q-item-section
            :clickable="groupSelectable"
            @click="groupClickable(getGroupId(group)) ? focusGroup(group) : ''"
            top="top"
            class="justify-center"
          >

Is being converted to this:

        q-item-section.justify-center(:clickable='groupSelectable' @click='groupClickable(getGroupId(group)) ? focusGroup(group) : ''' top='top')
          slot(name='tabgroup' v-bind:group='group')
            q-item-label.title.strong.text-primary.t16 {{ group.title }}

... which is not parseable because it now has triple single quotes. It should be converted to this:

        q-item-section.justify-center(:clickable="groupSelectable" @click="groupClickable(getGroupId(group)) ? focusGroup(group) : ''" top="top")
          slot(name="tabgroup" v-bind:group="group")
            q-item-label.title.strong.text-primary.t16 {{ group.title }}

My feeling is that original quotes should be preserved. Why change them? That just leads to crazy errors like this. Please note the error is subtle; focusGroup is being set to an empty string within double quotes focusGroup(group) : ''.. i.e. element( prop="emptyString=''")