Skip to content

Only href gets rendered for links #135

Open

Description

@claeyswo

for link in self.__atom_link or []:

Due to this commit 966fea4

This is our self.__atom_link object

image

But because in this line the link from the loop gets overwritten, all the subsequent gets do nothing.

Changing the code back to this, fixes our problem.

        for l in self.__atom_link or []:
            link = xml_elem('link', entry, href=l['href'])
            if l.get('rel'):
                link.attrib['rel'] = l['rel']
            if l.get('type'):
                link.attrib['type'] = l['type']
            if l.get('hreflang'):
                link.attrib['hreflang'] = l['hreflang']
            if l.get('title'):
                link.attrib['title'] = l['title']
            if l.get('length'):
                link.attrib['length'] = l['length']

Activity

  1. changed the title [-]atom_link gets overwritten by xml_elem[/-] [+]Only href gets rendered for links[/+] on Jan 19, 2024
  2. DonaldKellett commented on Feb 15, 2024

    @DonaldKellett

    Recently ran into this issue as well, when using both FeedEntry.link and FeedEntry.enclosure in the same entry for embedding the link to my blog post and the cover image respectively caused the generated Atom XML string to fail W3C Atom 1.0 validation tests indicating that a single Atom entry cannot have two links with rel="alternate" simultaneously.

    I've removed all images from my feed for the time being as a workaround, but would love to see it fixed so I may start including images again in my feed entries.

  3. ldotlopez commented on May 10, 2024

    @ldotlopez

    I just stumbled upon this bug, no updates on the PR?

  4. added a commit that references this issue on Dec 24, 2024
  5. MarkWieczorek commented on Sep 18, 2026

    @MarkWieczorek

    I just found this as well, and I will just add that the documentation states the following:

    rel contains a single link relationship type. It can be a full URI, or one of the following predefined values (default=alternate)

    This, however, is not really true as the rel tag doesn't get added to the link in the feed. Some RSS feed readers explicitly check to see if rel='alternate' is set before deciding what to do. In particular, for the Mattermost RSSfeed plugin, these links are simply discarded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions