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

253
Views
Readability - how do I keep parts of content that get omitted?

I'm working with Readability library from Mozilla to show simplified content of articles and blogposts. But I would like to keep certain content based either on HTML tag or class, for example <time> elements. How can I do that?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After looking into the code, it seems there isn't any user-exposed functionality for this, but you can do it quite easily if you don't mind editing the source code. There's an array PHRASING_ELEMS in Readability.js (line 159 at the time of writing) that determines which element tag names to preserve.

You'll need to modify that array yourself to achieve what you want, either by editing your local copy of Readability or by making a fork of the source code with your custom array and then using that in place of the original (or even better, fork and change it so that users can define their own included/excluded element arrays in the constructor options to solve the root problem here).

about 4 years ago · Juan Pablo Isaza Report
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!