File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/babel-plugin-transform-jsx-to-htm Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,14 @@ import jsx from '@babel/plugin-syntax-jsx';
44 * @param {Babel } babel
55 * @param {object } [options]
66 * @param {string } [options.tag='html'] The tagged template "tag" function name to produce.
7- * @param {boolean } [options.terse=false] Output `<//>` for closing component tags
7+ * @param {boolean } [options.terse=false] Use `<//>` for closing component tags
88 * @param {string | boolean | object } [options.import=false] Import the tag automatically
99 */
1010export default function jsxToHtmBabelPlugin ( { types : t } , options = { } ) {
1111 const tagString = options . tag || 'html' ;
1212 const tag = dottedIdentifier ( tagString ) ;
1313 const importDeclaration = tagImport ( options . import || false ) ;
14+ const terse = options . terse === true ;
1415
1516 function tagImport ( imp ) {
1617 if ( imp === false ) {
@@ -118,7 +119,6 @@ export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
118119 for ( let i = 0 ; i < children . length ; i ++ ) {
119120 let child = children [ i ] ;
120121 if ( t . isStringLiteral ( child ) ) {
121- // @todo - expose `whitespace: true` option?
122122 escapeText ( child . value ) ;
123123 }
124124 else if ( t . isJSXElement ( child ) ) {
@@ -131,7 +131,7 @@ export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
131131
132132 if ( ! isFragment ) {
133133 if ( isComponentName ( name ) ) {
134- if ( options . terse ) {
134+ if ( terse ) {
135135 raw ( '<//>' ) ;
136136 }
137137 else {
You can’t perform that action at this time.
0 commit comments