1
0
Fork 0
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:
Frédéric Guillot 2017-12-13 21:30:40 -08:00
parent 827683ab59
commit c6d9eb3614
7 changed files with 39 additions and 3 deletions

View file

@ -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
}