Juris-M / citeproc-js

A JavaScript implementation of the Citation Style Language (CSL) https://citeproc-js.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug(CSL.Output.Formats.prototype.fo): start-indent and end-indent invalid values

mgr34 opened this issue · comments

commented

In the FO output the values expected by FO for start-indent[1] and end-indent [2] should be one of length | percentage. However, in my limited tests the value is boolean. Which is invalid, and not useful for any FO processor. This appears to be because the value is derived from the boolean hanging-indent [3]. It's method of supplying a negative (-) preceeding the attribute value of end-indent is, as far as I know, the accepted way to render a hanging-indent in FO.

If you deem this a valid bug I would be happy to throw a PR together. Otherwise, I will continue to simply post process the output to replace trueem with the value of my choosing (3em). Note, that when I post-process I also find it necessary to throw an xmlns in for fo, or my xquery transformation throws a fit when I call parse-xml-fragment about it being not well-formed. This last bit is not relevant to the issue, but it might solve someone else's issue somewhere, sometime :)

[1] https://www.w3.org/TR/xsl11/#start-indent
[2] https://www.w3.org/TR/xsl11/#end-indent
[3]

citeproc-js/citeproc.js

Lines 22557 to 22558 in aa2683f

var hi = state.bibliography.opt.hangingindent;
indent = " start-indent=\"" + hi +"em\" text-indent=\"-" + hi + "em\"";

How would the appropriate length of percentage value be determined?

commented

That's a fair question. In short, I don't know. But more specifically the formatter is trying to use em's and the value should be an integer. At present a true or false value is returned and promptly ignored by the fo processor.