It seems that handlebars compiler is removing any html even when using the "triple-stash"{{{.
I have this in my template <h1>{{{title}}}</h1> and in my data file I have {"title": "Foo<br>bar"}, yet the title is stripped of any html, ending as plainly as Foo bar.
Here's my webpack.config.js file:
var debug = process.env.NODE_ENV !== "prod";
var page = process.env.PAGE || 'page-name';
var webpack = require('webpack');
var HbsPlugin = require('handlebars-webpack-plugin');
var hbsPlugin = new HbsPlugin({
entry: __dirname + '/src/index.hbs',
output: __dirname + '/dist/index.html',
data: require('./src/data.json')[page]
});
module.exports = {
entry: __dirname + "/src/app.js",
output: {
path: __dirname + "/dist",
filename: "app.min.js"
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
query: { presets: ['es2015'] }
}
]
},
plugins: debug
? [
hbsPlugin
]
: [
hbsPlugin,
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false }),
]
};
It seems that handlebars compiler is removing any html even when using the "triple-stash"
{{{
.I have this in my template
<h1>{{{title}}}</h1>
and in my data file I have{"title": "Foo<br>bar"}
, yet the title is stripped of any html, ending as plainly asFoo bar
.Here's my
webpack.config.js
file:Am I doing something wrong?
Thanks!