Closed elijahjorell closed 3 years ago
Issue: Pug4J render is not outputting correct html.
I have a simple pug file containing:
doctype html html body h1 Heading 1
However when I use the Pug4J render method, it outputs as: <!DOCTYPE htmlnhtmln bodyn h1 Heading 1>
<!DOCTYPE htmlnhtmln bodyn h1 Heading 1>
This is being run inside a simple (newly created) servlet
@WebServlet("/HomeServlet") public class HomeServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * Default constructor. */ public HomeServlet() { // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Map<String, Object> model = new HashMap<String, Object>(); model.put("pageTitle", "INDEX PUG VERSION"); Pug4J.render(getServletContext().getRealPath("/WEB-INF/views/index.pug"), model, response.getWriter()); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
I've attached my Eclipse Maven Project below. PugTest.zip
You are having windows line endings in your index.pug. Converting this to unix line ending style should give better results.
Please try 2.0.0-alpha-3
Issue: Pug4J render is not outputting correct html.
I have a simple pug file containing:
However when I use the Pug4J render method, it outputs as:
<!DOCTYPE htmlnhtmln bodyn h1 Heading 1>
This is being run inside a simple (newly created) servlet
I've attached my Eclipse Maven Project below. PugTest.zip