0

I have a question regarding Node, Pug and Marked. I have one, specific place where I'll be adding reports and I'd like them to have simple formatting (bold, links etc).

It seems that everything is working fine but when it imports data from database which I import like that:

#{marked(meeting.report)}

But it seems that PUG adds < > before and after imported data which gives such output:

< Meeting report >

Could someone tell me if there is any solution for that?

2
  • 1
    What is marked doing? What is the actual output you're trying to get? We're missing some key details here in order to help you. Commented Sep 28, 2020 at 2:45
  • Thank you for your reply and I'm sorry I wasn't very specific! MarkedJS uses marked formatting (like wrapping text around ** some text ** makes it bold). I am getting the right output but PUG adds <> brackets and I was wondering if someone could help me with getting rid of those. Commented Sep 28, 2020 at 10:33

1 Answer 1

1

In order to allow markedJS formatting, I used PUG's unescaped rendered code:

p!= marked(meeting.report)
Sign up to request clarification or add additional context in comments.

Comments

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.