fix: missing links

* skip removing <a> elements with published date in the url
This commit is contained in:
Hongbo Wu 2023-06-26 11:50:50 +08:00
parent 8d3db4161b
commit a964c59d80
2 changed files with 3 additions and 1 deletions

View file

@ -1059,6 +1059,8 @@ Readability.prototype = {
if (node.className === 'omnivore-published-date' && this._isValidPublishedDate(node.textContent)) {
return new Date(node.textContent);
}
// we don't want to check for dates in the URL's
if (node.tagName.toLowerCase() === 'a') return
// Searching for the real date in the text content
let dateRegExpFound = this.REGEXPS.DATES_REGEXPS.find(regexp => regexp.test(node.textContent.trim()))
dateRegExpFound && (dateRegExpFound = dateRegExpFound.exec(node.textContent.trim()))

View file

@ -3,7 +3,7 @@
<!-- .entry-media -->
<div>
<DIV data-adtags-visited="true">
<p> Im minding my own business, wandering around the Internet when I am smacked in the eyes by an interesting blog title “Dwarf begone! Five early medieval ways to rid yourself of dwarfs” ()</p>
<p> Im minding my own business, wandering around the Internet when I am smacked in the eyes by an interesting blog title “Dwarf begone! Five early medieval ways to rid yourself of dwarfs” (<a href="https://thijsporck.com/2020/05/03/dwarf-begone/">https://thijsporck.com/2020/05/03/dwarf-begone/</a>)</p>
<p> I believe it is the worst kept secret that I tend to be easily earwormed, and an even worse kept one that a “song” called Diggy, Diggy hole is particular effective as a weaponised version. (I recommend the Wind Rose version if you need to check it out) I was amused, then, to read: </p>
</DIV>
<DIV data-adtags-visited="true">