Share

Docutils: Documentation Utilities

Tracker: Bugs

5 HTML writer adds inappropriate whitespace - ID: 2822489
Last Update: Comment added ( phansen )

When using the abbr role with HTML output, a newline is inserted
inappropriately in the "abbr" element after the text. An example where
this produces incorrect output is "(:abbr:`TLA (Three Letter Acronym)`)".
The output will show the abbreviation in parentheses with a leading space
like "( TLA)" because of the newline that's added.

Admittedly this is unusual, putting an abbreviation inside parentheses, but
I doubt it can be called wrong. It's a fairly trivial issue, but I think
it might be an indication of other similar problems because of how the
starttag() routine works. It has a default argument suffix='\n', and few
things in writers/html.py override that. A fix for this particular bug is
to add suffix='' to the self.starttag() call in
writers.html.visit_abbreviation().


Peter Hansen ( phansen ) - 2009-07-16 14:12

5

Closed

Invalid

David Goodger

None

None

Public


Comments ( 2 )

Date: 2009-07-16 15:08
Sender: phansen

My bad, the problem is in the Sphinx visit_abbreviation() routine, not in
the docutils one. (I'm still in the "getting lost in the code" stage on
these tools.)

I can confirm that the implementation of visit_abbreviation() in docutils
in fact correctly overrides the "suffix" arg to avoid the problem anyway.
I'll report against Sphinx instead. Sorry to waste your time and thanks
for the quick response.


Date: 2009-07-16 14:53
Sender: goodgerProject AdminAccepting Donations

I cannot reproduce this issue.

Which version of Docutils are you using?

"abbr" is not supported in stock Docutils ("abbreviation" is, although it
doesn't do anything; there is only stub code for it).

When I tried "hello (:abbreviation:`TLA (Three Letter Acronym)`) there" as
input, I saw no newline or space in the output (using the latest Docutils
from the repository).

Please provide the command & input file you used, and the output you get.

Marked invalid/pending, but will reopen if you can provide evidence so we
can reproduce the bug.


Attached File

No Files Currently Attached

Changes ( 7 )

Field Old Value Date By
status_id Pending 2009-07-16 15:08 phansen
allow_comments 1 2009-07-16 15:08 phansen
close_date 2009-07-16 14:53 2009-07-16 15:08 phansen
status_id Open 2009-07-16 14:53 goodger
close_date - 2009-07-16 14:53 goodger
resolution_id None 2009-07-16 14:53 goodger
assigned_to nobody 2009-07-16 14:53 goodger