double space in demo.html

0 views
Skip to first unread message

Carles Pina

unread,
Jul 14, 2010, 7:40:02 AM7/14/10
to citeproc-js mailing list
(sorry for all mails in a row... this is the last one at the moment :-) )

Hello,

Checking the generated HTML from
http://gsl-nagoya-u.net/http/pub/citeproc-demo/demo.html
(for example, using Firefox and Web Developer extension and pressing
in View Source - View Generated Source) I can see that, for the IEEE
style, there are some double-spacing after some commas:

Before New York:
<div class="csl-left-margin">[1]</div><div
class="csl-right-inline"> D’Arcus, B., <i>Boundaries of Dissent:
Protest and State Power in the Media Age</i>, New York: Routledge,
2006.</div>

Before vol. 18:
<div class="csl-left-margin">[2]</div><div
class="csl-right-inline"> Bennett, F.G., Jr., “Getting Property Right:
‘Informal’ Mortgages in the Japanese Courts,” <i>PRL &amp; PJ</i>,
vol. 18, Aug. 2009, p. 463-509.</div>

It's not critical since it's HTML and a double spacing is like one
spacing, but it's potentially a bug in citeproc-js or in the style
itself. Plus, it can affect when sending the HTML to some text
processor (if it's not using the standard HTML importer).

Do you want that I open an issue in
http://bitbucket.org/fbennett/citeproc-js/wiki/Home ? Is it an issue
in your opinion?

[Side note: I've found some similar cases with full stop and other
tests, I'll report soon but I need to check if it's some problem with
the .CSL file. My general idea is that citeproc-js should never
generate bibliographies with more than one full stop/coma/etc.
together (what I've seen is that the suffix of a URL is ".", and then
the suffix of the general layout is again "." resulting with two
consecutives full stops). ]

Cheers,

--
Carles Pina | Software Engineer
http://www.mendeley.com/profiles/Carles-Pina/

Mendeley Limited | London, UK | www.mendeley.com
Registered in England and Wales | Company Number 6419015

Frank Bennett

unread,
Jul 14, 2010, 7:45:18 PM7/14/10
to citeproc-js
On Jul 14, 8:40 pm, Carles Pina <carles.p...@mendeley.com> wrote:
> (sorry for all mails in a row... this is the last one at the moment :-) )

No problem, that's how things get done.

>
> Hello,
>
> Checking the generated HTML fromhttp://gsl-nagoya-u.net/http/pub/citeproc-demo/demo.html
> (for example, using Firefox and Web Developer extension and pressing
> in View Source - View Generated Source) I can see that, for the IEEE
> style, there are some double-spacing after some commas:
>
> Before New York:
> <div class="csl-left-margin">[1]</div><div
> class="csl-right-inline"> D’Arcus, B., <i>Boundaries of Dissent:
> Protest and State Power in the Media Age</i>, New York: Routledge,
> 2006.</div>
>
> Before vol. 18:
> <div class="csl-left-margin">[2]</div><div
> class="csl-right-inline"> Bennett, F.G., Jr., “Getting Property Right:
> ‘Informal’ Mortgages in the Japanese Courts,” <i>PRL &amp; PJ</i>,
> vol. 18, Aug. 2009, p. 463-509.</div>
>
> It's not critical since it's HTML and a double spacing is like one
> spacing, but it's potentially a bug in citeproc-js or in the style
> itself. Plus, it can affect when sending the HTML to some text
> processor (if it's not using the standard HTML importer).

It's definitely a bug. Thanks for inspecting the output so closely.

>
> Do you want that I open an issue inhttp://bitbucket.org/fbennett/citeproc-js/wiki/Home? Is it an issue
> in your opinion?

I've pushed a fix that addresses this particular case. It hasn't been
rigorously tested, but should cover most cases where this might
happen.

>
> [Side note: I've found some similar cases with full stop and other
> tests, I'll report soon but I need to check if it's some problem with
> the .CSL file. My general idea is that citeproc-js should never
> generate bibliographies with more than one full stop/coma/etc.
> together (what I've seen is that the suffix of a URL is ".", and then
> the suffix of the general layout is again "." resulting with two
> consecutives full stops). ]
>
> Cheers,
>
> --
> Carles Pina | Software Engineerhttp://www.mendeley.com/profiles/Carles-Pina/

Carles Pina

unread,
Jul 15, 2010, 8:10:39 AM7/15/10
to citep...@googlegroups.com
Hello,

On 15 July 2010 00:45, Frank Bennett <bierc...@gmail.com> wrote:
> On Jul 14, 8:40 pm, Carles Pina <carles.p...@mendeley.com> wrote:

>> Do you want that I open an issue inhttp://bitbucket.org/fbennett/citeproc-js/wiki/Home? Is it an issue
>> in your opinion?
>
> I've pushed a fix that addresses this particular case.  It hasn't been
> rigorously tested, but should cover most cases where this might
> happen.

It fixed the case from the demo page. But it hasn't fixed other cases
from my integration tests.

Find attached a patch to add a test case that currently is failing and
should be passing:
(feel free to change the name of the unit test, I wasn't sure which
name use for it)

carles@carles:~/citeproc-js-test$ ./test.py -s simplespace case1
....
<div class="csl-bib-body">
<div class="csl-entry">Doe, J., 1992. In <i>Some title</i>.
Vintage, p. 250-300.</div>
....

Before "Vintage" there are two spaces.

The file harvard1.csl is downloaded some time ago from Zotero and
converted to CSL 1.0 using update.xsl.

If I have time I'll try to simplify the harvard1.csl to would have
only the relevant part.

When this is fixed in citeproc-js I'll run my tests to see if there is
some other case that needs fixing.

Thanks,

--
Carles Pina | Software Engineer

simplespace_case1.patch
Reply all
Reply to author
Forward
0 new messages