0

I'm new at node.js and i'm using handlebars(hbs), i have created a views and some partials, and everything goes well, but the problem is the rendered partials have unnecessary spaces which makes the page looks bad, here is my code : handlebars view

{{>header}}
<h1>{{ title }}</h1>
{{>footer}}

handlebars partial (footer)

<footer>
   Created By Hassan Ali
</footer>

and here is my app.js

const path = require("path")
const express = require("express")
const hbs = require("hbs")
const app = express()

// Folders Pathes
var publicFolder = path.join(__dirname, "../public")
var viewsFolder = path.join(__dirname, "../templates/pages")
var partialsFolder = path.join(__dirname, "../templates/components")

// Setting The View Engine
app.set('view engine', 'hbs')
// Setting The Views Directory
app.set('views', viewsFolder)
// Setting The Views Components
hbs.registerPartials(partialsFolder)
// Setting The Static Folder
app.use(express.static(publicFolder))

app.get("/notes", (req, res) => {
   res.render("notes", {
      title: "Notes App"
   })
})

and when it's rendered i get some unnecessary spaces in the html before every partial with this &-#65279; entity (without - that after &)

&#65279;
<header>
Header Tag
</header>

<h1>Title of The Page</h1>

&#65279;
<footer>
   Created By Hassan Ali
</footer>

any help will be appreciated.

EDIT: The problem is solved Thanks

0 Answers0