mjbvz / vscode-lit-html

Adds syntax highlighting for html inside of JavaScript and TypeScript tagged template strings
https://marketplace.visualstudio.com/items?itemName=bierner.lit-html
MIT License
319 stars 75 forks source link

HTML only tags #15

Closed janat08 closed 6 years ago

janat08 commented 6 years ago

I believe this is tagged template literal w(data, ":calendar")..., yet extension doesn't work. Would you try parsing for things other than HTML since it could be abbreviated and you claim to support this family of languages?

mjbvz commented 6 years ago

I don't understand. Please provide a complete code example of what you want supported

janat08 commented 6 years ago
render(h, st){

  return h`

        <div class="calendar container-fluid">
        <div class="month page-header calendar">
          <h3> Schedule</h3>
          <ul class="pager">
            <li onclick=${this.previous}>
              <a>Previous</a>
            </li>
            <span> ${st.calendarTitle}</span>
            <li onclick=${this.next}>
              <a >Next</a>
            </li>
          </ul>
        </div>
        <div class="calendar heading row">
          <ul class="nav nav-tabs nav-justified">
          ${st.weekPeriods.map((x, i) => {
    function switchWeek(){
      return a.switchWeek(i)
    }
    return w(x)`<li role="presentation" onclick=${switchWeek} class=${i == st.currentWeek ? "active" : ""}>
        <a >${"WEEK " + (i + 1)}</a>
        </li>`

  })
    }

        </div>`
mjbvz commented 6 years ago

This extension is targeting the html and raw tagged templates most commonly used with lit-html and other frameworks. Unless I misunderstand the example, your example is out of scope

janat08 commented 6 years ago

From what I understand hyperhtml is pretty much the other framework. regex for () will pretty much cover vanilla hyperhtml.