pugjs / babel-plugin-transform-react-pug

A plugin for transpiling pug templates to jsx
MIT License
811 stars 47 forks source link

Inline HTML not working #47

Closed PeterHatch closed 5 years ago

PeterHatch commented 6 years ago

So when using inline HTML it's getting output as literal text, when I'd like it to be processed as JSX.

For example, p This is plain old <em>text</em> content. (which is an example from the Pug documentation) outputs a paragraph containing "\<em>text\</em>", rather than an em element.

This can be worked around, I think - I found using interpolated tags, like p This is plain old #[em text] content. works for me for now. Still, I think it'd be nice if it worked; even just documenting that it doesn't work would have helped me.

(All assuming this isn't just an issue with my setup; if it works for other people, I'll look into the issue more.)

ezhlobo commented 6 years ago

@PeterHatch hey, thank you for mentioning this. Unfortunately this is not supported right now and I believe it won't be done in near future since native pug syntax #[strong text] works.

I agree that we need to let others know about it. I created a PR with better documentation (it's waiting for being reviewed). I'll extend it soon or after merging with this information to README.