webpack-contrib / i18n-webpack-plugin

[DEPRECATED] Embed localization into your bundle
MIT License
318 stars 74 forks source link

inline html (br, strong, em) #37

Closed sidonaldson closed 7 years ago

sidonaldson commented 7 years ago

Is there a way to include html elements such as strong, br, em etc?

I've tried adding them as text and also entities but they still show as text content.

Any help is really appreciated :)

EcutDavid commented 7 years ago

Hi @sidonaldson, it's not related to this plugin. This plugin only handle the text transform part, we need consider how to transform these text in DOM by ourselves.

sidonaldson commented 7 years ago

Thanks @EcutDavid

You're right. In my specific case I couldn't get the inline html to show in a handlebars template and I've since learnt that you need to using their HTML escaping syntax of triple curly braces!

<h1>{{{htmlWebpackPlugin.options.data.title}}}</h1>

and with React you would need to use dangerouslySetInnerHTML etc.

Hope this helps others.