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

Validation of <em> and <code> inside <li> elements fails #418

Open
uklotzde opened this issue Sep 20, 2021 · 6 comments
Open

Validation of <em> and <code> inside <li> elements fails #418

uklotzde opened this issue Sep 20, 2021 · 6 comments

Comments

@uklotzde
Copy link

According to the spec both <em> and <code> elements can be used in <li> elements in descriptions:

Within paragraphs and list items, emphasis (em) and inline code (code) text styles are supported.

Unfortunately, validation fails with appstream-util 0.7.18 (Fedora 34):

appstream-util validate-relax --nonet res/linux/org.mixxx.Mixxx.metainfo.xml 
res/linux/org.mixxx.Mixxx.metainfo.xml: failed to parse res/linux/org.mixxx.Mixxx.metainfo.xml: Error on line 236 char 5: <li> already set 'It is no longer necessary to manually copy the udev rule file in packaging scripts. Now pkg-config is used to determine the udevdir used to install the rules file in the CMake install step when CMAKE_INSTALL_PREFIX is' and tried to replace with '
   or
   '

Example: org.mixxx.Mixxx.metainfo.xml

Validation with appstreamcli succeeds:

appstreamcli validate --no-net res/linux/org.mixxx.Mixxx.metainfo.xml 
I: org.mixxx.Mixxx:~: content-rating-missing

Validation was successful: infos: 1, pedantic: 1
@hughsie
Copy link
Owner

hughsie commented Sep 21, 2021

I think using appstreamcli validate is probably the right thing to use these days.

@uklotzde
Copy link
Author

Thanks for the confirmation. We already switched to appstreamcli as a workaround and we could stick with it if recommended.

@Be-ing
Copy link

Be-ing commented Sep 30, 2021

I am running into this bug using flatpak-builder:

Rewriting contents of org.mixxx.Mixxx.desktop
Running appstream-compose
Processing application org.mixxx.Mixxx
Error loading AppData file: failed to parse /app/share/appdata/org.mixxx.Mixxx.appdata.xml: Error on line 265 char 5: <li> already set 'It is no longer necessary to manually copy the udev rule file in packaging scripts. Now pkg-config is used to determine the udevdir used to install the rules file in the CMake install step when CMAKE_INSTALL_PREFIX is' and tried to replace with '
   or
   '
Error: ERROR: appstream-compose failed: Child process exited with code 1

@Be-ing
Copy link

Be-ing commented Sep 30, 2021

Ugly hack around this in the Flatpak manifest:

    post-install:
      - sed -i 's/<code>//g' ${FLATPAK_DEST}/share/metainfo/org.mixxx.Mixxx.metainfo.xml
      - sed -i 's/<\/code>//g' ${FLATPAK_DEST}/share/metainfo/org.mixxx.Mixxx.metainfo.xml

@ximion
Copy link
Collaborator

ximion commented Oct 1, 2021

In the long run flatpak/flatpak#4426 will add support for that in some form, unless appstream-glib implements dedicated support.
The only immediate fix I can see though is your sed hack :-/

@kparal
Copy link

kparal commented Jan 10, 2022

I have the same problem with <em> and <code> in <description>. This fails to parse:

<description>
    <p>foo <em>bar</em> <code>baz</code> qux</p>
</description>
$ appstream-util validate-relax fail.appdata.xml 
failed to parse fail.appdata.xml: Error on line 7 char 46: <p> already set 'foo' and tried to replace with ' qux'

This is with libappstream-glib-0.7.18-3.fc35.x86_64.

Because of this, I can't have markup in package description on Flathub.

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

No branches or pull requests

5 participants