Vitaliy-1 / JATSParserPlugin

OJS3 Plugin for parsing JATS XML and displaying it on article detail page
GNU General Public License v3.0
27 stars 24 forks source link

"&" ampersand not recognized #78

Open MathiasCimelli opened 1 year ago

MathiasCimelli commented 1 year ago

Hi vitaliy-1,

I think JATSParser doesn't recognise the encoded character "&".

I have tested the three critical characters to XML (< / > are correctly interpreted) but the ampersand (&) is not. That's cause problems in the full text rendering.

Best regards, CimelliM

Vitaliy-1 commented 1 year ago

Hi @MathiasCimelli,

Do you mean &amp; encoding sequence for ampersand or something else?

MathiasCimelli commented 1 year ago

Hi,

Yes, when i try to display in full text a sign "&" he disapear and leave an error in the following text. Example : I have a title

named "Methods & Material" And the result in the full text is my title as desapeared and the close tag of the

tag is not more writed, so the following text take the form of the title.

In the xml the tag & is present but with the parser that leave a blank.

Thank you, CimelliM

rinorazzi commented 1 year ago

Hi @Vitaliy-1

I have the same issue as @MathiasCimelli. It occurs when the title tag of a section contains &#x0026; which is the HEX encoded HTML entity for "&" (ampersand).

Here is an example.

<sec id="sec1-2">
<title>BACKGROUND &#x0026; AIMS</title>
<p> ....</p>

In this example the parsing of the title breaks and the HTML generated by JatsParser contains an open <h2> tag without the corresponding </h2> closure.

This happens with version 2.1.9.3 of JatsParser.

The same issue also occurs in an older versions of JatsParser (compatible with OJS 3.1,2) but the effect is different: in that case the <h2> gets closed but the portion of the title after the & is cut. So, with the above XML example the generated HTML would be <h2>BACKGROUND</title>