Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
Get encoded content from javascript object and display it on pug, how?

I got an XML which contained tag <content:encoded> which I have processed to this form. There are several tag and I am currently struggle at this particular tag. Example :

{
  title: [
    'the title goes here'
  ],
  link: [
    'https://anotherlink.com'
  ],
  description: [
    '<img src="https://something.com/foo.jpg"/>Some words here'
  ],
  'content:encoded': [
    'This content is what I want to get, also with escaped characters included'
  ],
  guid: [
    'https://something.com'
  ]
}

my pug page:

extends mp

block layout-content
  div.View
    h1.Banner Hello!
    data_in
    ul
      each element in data_in
          li
            div.Message
              div.Title
                h1= element.title                  >this gets expected output
                h3= element.content|encoded        >this gets wrong output

How do I get that encoded content , while with the same code do well when I getting the 'title' attribute ? Do I have to do another iteration ? Thank you

*edit : I mean , 'title' value

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!