mirror of
https://github.com/miniflux/v2.git
synced 2025-07-02 16:38:37 +00:00
Improve content scraper
This commit is contained in:
parent
827683ab59
commit
c6d9eb3614
7 changed files with 39 additions and 3 deletions
|
@ -5,6 +5,7 @@
|
|||
package rewrite
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
|
@ -38,3 +39,10 @@ func addYoutubeVideo(entryURL, entryContent string) string {
|
|||
}
|
||||
return entryContent
|
||||
}
|
||||
|
||||
func addPDFLink(entryURL, entryContent string) string {
|
||||
if strings.HasSuffix(entryURL, ".pdf") {
|
||||
return fmt.Sprintf(`<a href="%s">PDF</a><br>%s`, entryURL, entryContent)
|
||||
}
|
||||
return entryContent
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue