2023-06-19 23:42:47 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2019-12-23 23:39:54 +01:00
|
|
|
|
2023-09-09 01:50:06 +02:00
|
|
|
package dublincore // import "miniflux.app/v2/internal/reader/dublincore"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"miniflux.app/v2/internal/reader/sanitizer"
|
|
|
|
)
|
2019-12-23 23:39:54 +01: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-09 01:50:06 +02: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 23:39:54 +01: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-09 01:50:06 +02:00
|
|
|
|
|
|
|
func (item *DublinCoreItemElement) GetSanitizedCreator() string {
|
|
|
|
return strings.TrimSpace(sanitizer.StripTags(item.DublinCoreCreator))
|
|
|
|
}
|