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

"<" is ignored in prefix #129

Closed
tnajdek opened this issue Oct 29, 2021 · 4 comments · Fixed by #130
Closed

"<" is ignored in prefix #129

tnajdek opened this issue Oct 29, 2021 · 4 comments · Fixed by #130
Labels
A-core Area: affects all builds of citeproc-rs

Comments

@tnajdek
Copy link
Member

tnajdek commented Oct 29, 2021

Some styles use "<" character in prefix (encoded as &lt;). This seems to be ignored and doesn't render.

@cormacrelf
Copy link
Collaborator

cormacrelf commented Oct 30, 2021

Prefixes of what kinds of things? I can't reproduce this on a <text prefix="&lt;" variable="title"> or URL, but there could be another element that has this problem. (It occurs to me I should make it so the demo/playground can give you shareable links.)

image

@tnajdek
Copy link
Member Author

tnajdek commented Oct 30, 2021

Sorry, it was quite late here when I've seen this and I just wanted to note down the issue so I don't forget.

I've seen this behaviour for DOI, it seems to happen regardless of link_anchors value. Here is an example CSL (from MHRA):

<text variable="DOI" prefix=" &lt;https://doi.org/" suffix="&gt;"/>

And here is screenshot from the playground:

Screenshot 2021-10-30 at 11 06 16

@cormacrelf
Copy link
Collaborator

Oh, I see it. It is over-parsing the affixes, because the superscript parser is only used inside the HTML parser. It needs to parse the hacky superscripts, but not actual HTML. The HTML5 parser used in citeproc-rs dutifully (and I presume correctly according to that spec) ignored an incomplete/invalid <https: tag and swallowed the rest of the input.

The affixes have their XML entities pre-processed, so that part is already done, the HTML parser doesn't need to be involved at all.

@cormacrelf
Copy link
Collaborator

This is a good catch, thanks.

@cormacrelf cormacrelf added the A-core Area: affects all builds of citeproc-rs label Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: affects all builds of citeproc-rs
Development

Successfully merging a pull request may close this issue.

2 participants