GandaG / pyfomod

A high-level fomod library written in Python.
https://pyfomod.rtfd.io/
Apache License 2.0
7 stars 6 forks source link

CDATA in xml tags are not parsed #4

Closed leontristain closed 5 years ago

leontristain commented 5 years ago

Not a blocker for me, just thought the issue ought to be logged. Thanks!

Steps to repro:

  1. Download the NMM version of Skyrim Special Edition mod "Insects Begone" (https://www.nexusmods.com/skyrimspecialedition/mods/1190?tab=files). This version comes with a FOMOD installer.

  2. Extract to a folder (let's say it's accessible at src/insects-begone)

  3. Observe the following behavior in python interpreter (using python 3.7.0, not sure if relevant):

    >>> import pyfomod
    >>> pyfomod.__version__
    '0.8.1'
    >>> root = pyfomod.parse('src/insects-begone')
    >>> root.pages[0][0][0].name
    'A reminder'
    >>> root.pages[0][0][0].description
    ''
    >>>
  4. Check the FOMOD xml to see this section:

    <plugin name="A reminder">
        <description>
        <![CDATA[Read the descriptions for each of the files, they explain completely what each one does so you know exactly what you are getting. Don't rush through this installation if you want it to work completely.]]>
        </description>
        <files>
        </files>
        <typeDescriptor><type name="Optional"/></typeDescriptor>
    </plugin>
GandaG commented 5 years ago

Thanks for the report, will look into it asap!

GandaG commented 5 years ago

@leontristain do me a favour and check if the description is correct if instead of

<description>
        <![CDATA[Read the descriptions for each of the files, they explain completely what each one does so you know exactly what you are getting. Don't rush through this installation if you want it to work completely.]]>
</description>

you have

<description><![CDATA[Read the descriptions for each of the files, they explain completely what each one does so you know exactly what you are getting. Don't rush through this installation if you want it to work completely.]]></description>

(all in one line)

leontristain commented 5 years ago

I will check this when I get home today.

leontristain commented 5 years ago

Just checked. Indeed if they're all part of the same line it will work.

leontristain commented 5 years ago

Specifically, if there's no whitespace between the <description> tag and the CDATA tag, it will work.