-
Notifications
You must be signed in to change notification settings - Fork 726
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strip HTML tags from DublinCore Creator tags
- Loading branch information
Showing
5 changed files
with
53 additions
and
20 deletions.
There are no files selected for viewing
20 changes: 17 additions & 3 deletions
20
internal/reader/rdf/dublincore.go → internal/reader/dublincore/dublincore.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package rdf // import "miniflux.app/v2/internal/reader/rdf" | ||
package dublincore // import "miniflux.app/v2/internal/reader/dublincore" | ||
|
||
import ( | ||
"strings" | ||
|
||
"miniflux.app/v2/internal/reader/sanitizer" | ||
) | ||
|
||
// DublinCoreFeedElement represents Dublin Core feed XML elements. | ||
type DublinCoreFeedElement struct { | ||
DublinCoreCreator string `xml:"http://purl.org/dc/elements/1.1/ channel>creator"` | ||
} | ||
|
||
// DublinCoreEntryElement represents Dublin Core entry XML elements. | ||
type DublinCoreEntryElement struct { | ||
func (feed *DublinCoreFeedElement) GetSanitizedCreator() string { | ||
return strings.TrimSpace(sanitizer.StripTags(feed.DublinCoreCreator)) | ||
} | ||
|
||
// DublinCoreItemElement represents Dublin Core entry XML elements. | ||
type DublinCoreItemElement struct { | ||
DublinCoreDate string `xml:"http://purl.org/dc/elements/1.1/ date"` | ||
DublinCoreCreator string `xml:"http://purl.org/dc/elements/1.1/ creator"` | ||
DublinCoreContent string `xml:"http://purl.org/rss/1.0/modules/content/ encoded"` | ||
} | ||
|
||
func (item *DublinCoreItemElement) GetSanitizedCreator() string { | ||
return strings.TrimSpace(sanitizer.StripTags(item.DublinCoreCreator)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters