mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Do not strip tags for entry title
Some technical blogs have titles like "</some-title>" or "This is some <code>source code</code>". Miniflux was removing these elements which prevent rendering the title correctly.
This commit is contained in:
parent
f0610bdd9c
commit
291bf96d15
7 changed files with 62 additions and 16 deletions
|
@ -951,7 +951,7 @@ func TestParseInvalidXml(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestParseWithHTMLEntity(t *testing.T) {
|
||||
func TestParseFeedTitleWithHTMLEntity(t *testing.T) {
|
||||
data := `<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
|
||||
<channel>
|
||||
|
@ -970,7 +970,30 @@ func TestParseWithHTMLEntity(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestParseWithInvalidCharacterEntity(t *testing.T) {
|
||||
func TestParseItemTitleWithHTMLEntity(t *testing.T) {
|
||||
data := `<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
|
||||
<channel>
|
||||
<link>https://example.org/</link>
|
||||
<title>Example</title>
|
||||
<item>
|
||||
<title></example></title>
|
||||
<link>http://www.example.org/entries/1</link>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>`
|
||||
|
||||
feed, err := Parse("https://example.org/", bytes.NewBufferString(data))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if feed.Entries[0].Title != "</example>" {
|
||||
t.Errorf(`Incorrect title, got: %q`, feed.Title)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseFeedLinkWithInvalidCharacterEntity(t *testing.T) {
|
||||
data := `<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
|
||||
<channel>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue