Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only href gets rendered for links #135

Open
claeyswo opened this issue Jan 18, 2024 · 2 comments · May be fixed by #136
Open

Only href gets rendered for links #135

claeyswo opened this issue Jan 18, 2024 · 2 comments · May be fixed by #136

Comments

@claeyswo
Copy link

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']
@claeyswo claeyswo changed the title atom_link gets overwritten by xml_elem Only href gets rendered for links Jan 19, 2024
emepetres added a commit to emepetres/python-feedgen that referenced this issue Feb 14, 2024
@emepetres emepetres linked a pull request Feb 14, 2024 that will close this issue
@DonaldKellett
Copy link

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.

@ldotlopez
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants