2023-06-19 17:42:47 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2019-12-23 17:39:54 -05:00
|
|
|
|
2023-09-08 19:50:06 -04:00
|
|
|
package dublincore // import "miniflux.app/v2/internal/reader/dublincore"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"miniflux.app/v2/internal/reader/sanitizer"
|
|
|
|
)
|
2019-12-23 17:39:54 -05:00
|
|
|
|
|
|
|
// DublinCoreFeedElement represents Dublin Core feed XML elements.
|
|
|
|
type DublinCoreFeedElement struct {
|
|
|
|
DublinCoreCreator string `xml:"http://purl.org/dc/elements/1.1/ channel>creator"`
|
|
|
|
}
|
|
|
|
|
2023-09-08 19:50:06 -04:00
|
|
|
func (feed *DublinCoreFeedElement) GetSanitizedCreator() string {
|
|
|
|
return strings.TrimSpace(sanitizer.StripTags(feed.DublinCoreCreator))
|
|
|
|
}
|
|
|
|
|
|
|
|
// DublinCoreItemElement represents Dublin Core entry XML elements.
|
|
|
|
type DublinCoreItemElement struct {
|
2019-12-23 17:39:54 -05:00
|
|
|
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"`
|
|
|
|
}
|
2023-09-08 19:50:06 -04:00
|
|
|
|
|
|
|
func (item *DublinCoreItemElement) GetSanitizedCreator() string {
|
|
|
|
return strings.TrimSpace(sanitizer.StripTags(item.DublinCoreCreator))
|
|
|
|
}
|