File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/babel-plugin-transform-jsx-to-tagged-templates/src Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,11 @@ function escapeValue(value) {
1111 * @param {Babel } babel
1212 * @param {object } [options]
1313 * @param {string } [options.tag='html'] The tagged template "tag" function name to produce.
14+ * @param {string } [options.html=false] If `true`, output HTML-like instead of XML-like (no self-closing tags, etc).
1415 */
1516export default function jsxToTaggedTemplatesBabelPlugin ( { types : t } , options = { } ) {
1617 const tag = dottedIdentifier ( options . tag || 'html' ) ;
18+ const htmlOutput = ! ! options . html ;
1719
1820 function dottedIdentifier ( keypath ) {
1921 const path = keypath . split ( '.' ) ;
@@ -82,7 +84,7 @@ export default function jsxToTaggedTemplatesBabelPlugin({ types: t }, options =
8284 }
8385 }
8486
85- if ( node . children && node . children . length !== 0 ) {
87+ if ( htmlOutput || node . children && node . children . length !== 0 ) {
8688 raw ( '>' ) ;
8789 for ( let i = 0 ; i < node . children . length ; i ++ ) {
8890 let child = node . children [ i ] ;
You can’t perform that action at this time.
0 commit comments