1

Suppose I store <b>bold text</b> in mysql column then I should get it as bold text And not as, <b>bold text</b>

I am using it in a nodejs app and using handlebars as view engine.

2 Answers 2

2

To display html with your handlebars template, you'll need to use {{{variable}}} not {{variable}} (replace 'variable' with your actual variable name.)

Sign up to request clarification or add additional context in comments.

Comments

0

If you wanted to inject a string into the DOM, you can do that pretty simply with innerHTML.

app.innerHTML = '<b>bold text</b>';

1 Comment

Actually I'm making a blog app. The blog body must contain html codes in order to format the page. My question is about that. I need to get the mysql data as text/html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.