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

Support for Citeproc bibliography tests #229

Open
Drodt opened this issue Oct 8, 2024 · 4 comments · May be fixed by #228
Open

Support for Citeproc bibliography tests #229

Drodt opened this issue Oct 8, 2024 · 4 comments · May be fixed by #228

Comments

@Drodt
Copy link
Contributor

Drodt commented Oct 8, 2024

Currently, all tests of the citeproc test suite that test the bibliography are ignored. Many important features are therefore untested. This should either be fixed or (if there are some issues I am unaware of) a comparable test suite for hayagriva should be build.

Are there any problems preventing support for Bibliography mode?

@Drodt Drodt linked a pull request Oct 8, 2024 that will close this issue
5 tasks
@reknih
Copy link
Member

reknih commented Oct 10, 2024

I have not enabled bibliography tests because they are yielded as HTML:

Note that in bibliography mode, the HTML string output used for testing will be affixed with a standard set of wrapper tags, which must be written into the result string used for comparison:

>>===== RESULT =====>>
<div class="csl-bib-body">
 <div class="csl-entry">J. Noakes, J. Doe, J. Roe (2005)</div>
 <div class="csl-entry">R. Stoakes (1898)</div>
</div>
<<===== RESULT =====<<

We do support formatting citations as HTML, but not exact string matches with citeproc.js. For example, we do not attach the csl-bib-body or csl-entry classes around entries, and neither do we do the same indentation / pretty printing. To use the bibliography mode tests, we'd need to do a combination of fuzzy matching (i.e. ignore more than one whitespace between tags) and adding the citeproc.js classes. I did not feel that that was worth the effort at the time when I added CSL tests but that calculus may have shifted in favor of having test cases now.

@Drodt
Copy link
Contributor Author

Drodt commented Oct 10, 2024

I am not all too familiar with the HTML output by citeproc. Would it make sense to extract the content of each csl-entry <div> and compare the content with each item of hayagriva's output?

@reknih
Copy link
Member

reknih commented Oct 10, 2024

The problem is that citeproc may yield additional HTML elements based on the value of the CSL display attribute

@reknih
Copy link
Member

reknih commented Oct 10, 2024

If we deep-extracted all text from both data models, it could work

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.

2 participants