How to make open characters work when you render a string stored in the HTML raw(?) database.

Asked 1 years ago, Updated 1 years ago, 109 views

The development environment is node.js and express.

Using ejs template.

Stored in database

"Hello.<br>Testing."

How do I load a string so that the tag works when I print it out to my browser?

Browser If loaded with tags

 Hello.
Testing.

I'd like to print it out on my browser.

"Hello.<br>Testing.""

It is printed as it is.

What I want to do is to find out how to save a string in the database to make the opening valid and loaded when loaded into the browser.

html rendering string newline

2022-09-22 20:33

1 Answers

It seems to have escaped automatically when I called.

You have to use the tag that you just call.

I think you used ejs last time, if it is correct

If you look at the Tags part on ,

It's a tag that prints as it is without a mask.


2022-09-22 20:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.