SMotaal / polyestr-tsx-lit-transform

A TypeScript TSX-to-template-literal transform that builds into the eco-system of Polyestr.
3 stars 0 forks source link

Newlines (and Whitespace in generally) in JSX are not being properly converted to Template Expressions #2

Open SMotaal opened 6 years ago

SMotaal commented 6 years ago

Input


            import { html, svg } from "../lit-html";
            export const template = ({id = '<id>', text = '<text>'}) => html`
                <div>${[
                    html`<p id=${id}>
                        ${html`<b>${name}</b>)}: ${text}
                    </p>`
                    html`<p id=${id}>
                        <b>${name}</b>: ${text}
                    </p>`,
                ]}</div>
            `;

Output


import { html, svg } from "../lit-html";
export const template = ({ id = "<id>", text = "<text>" }) => html `\n                <div>${[
    html `<p id=${id}>\n                        ${html `<b>${name}</b>)}: ${text}\n                    </p>`}`,
    html `<p id=${id}>\n                        <b>${name}</b>: ${text}\n                    </p>`,
]}</div>\n            `;

Versions

SMotaal commented 6 years ago

Tracking it as a TypeScript Transformation API related bug: Transform: unable to control or preserve whitespace in substituted template spans