1.0.3 • Published 3 years ago
commentless-tag v1.0.3
commentless-tag
Removes commented lines before passing it on to another template tag.
Only lines commented with // are removed.
Example:
import commentless from 'commentless-tag'
import {identityTag as identity} from 'identity-tag'
const output = commentless(identity)`
  <div>
    // <span></span>
    <span></span>
    // <button prop=${'1'} class="button"> 
    //   Back 
    // </button>
    <button prop=${'2'} class="button"> 
      Back 
    </button>
  </div>
`
console.log('output', output)
/* prints:
output 
  <div>
    
    <span></span>
    
    
    
    <button prop=2 class="button"> 
      Back 
    </button>
  </div>
* */