according to the FAQ, non-breaking spaces must be entered as either
entities or attributes. Are there technical reasons for this? One of
the advantages of Asciidoc is that documents are readable, and having
either an entity or an attribute instead of a non-breaking space
character hampers readibility. Provided that the document uses a
suitable encoding (i.e. utf-8), could non-breaking spaces be
recognized as such and handled accordingly?
On 3 September 2012 03:22, Elena <egarr...@gmail.com> wrote:
> Hello,
> according to the FAQ, non-breaking spaces must be entered as either
> entities or attributes. Are there technical reasons for this? One of
> the advantages of Asciidoc is that documents are readable, and having
> either an entity or an attribute instead of a non-breaking space
> character hampers readibility. Provided that the document uses a
> suitable encoding (i.e. utf-8), could non-breaking spaces be
> recognized as such and handled accordingly?
Hi,
Although the current asciidoc does its best with non-ascii characters,
it is limited by Python 2, and should really be considered *ascii*doc
as far as the input is concerned. Long term the Python 3 port will
probably have better unicode support but there is no schedule for its
release.
Even then I am not sure that putting nbsp in the document is a good
idea. It is not visually differentiable from the ascii space so
particular rendering effects would be unexpected, someone editing may
easily replace it with a space and break the output etc. In general
despite the visual noise I would stick with an explicit marking of
something with special semantics. You could of course choose your
attribute or replacement (something you didn't mention) to minimise
the visual effect.
> --
> You received this message because you are subscribed to the Google Groups "asciidoc" group.
> To post to this group, send email to asciidoc@googlegroups.com.
> To unsubscribe from this group, send email to asciidoc+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/asciidoc?hl=en.
On Sun, Sep 02, 2012 at 01:22:34PM EDT, Elena wrote:
> according to the FAQ, non-breaking spaces must be entered as either
> entities or attributes. Are there technical reasons for this? One of
> the advantages of Asciidoc is that documents are readable, and having
> either an entity or an attribute instead of a non-breaking space
> character hampers readibility. Provided that the document uses
> a suitable encoding (i.e. utf-8), could non-breaking spaces be
> recognized as such and handled accordingly?
Have you tried it?
I was not aware of this particular FAQ but I have never had any problems
with literal U+000A non-break spaces in my documents.. at least with
html and pdfs generated via a2x.
> On Sun, Sep 02, 2012 at 01:22:34PM EDT, Elena wrote:
>> according to the FAQ, non-breaking spaces must be entered as either
>> entities or attributes. Are there technical reasons for this? One of
>> the advantages of Asciidoc is that documents are readable, and having
>> either an entity or an attribute instead of a non-breaking space
>> character hampers readibility. Provided that the document uses
>> a suitable encoding (i.e. utf-8), could non-breaking spaces be
>> recognized as such and handled accordingly?
> Have you tried it?
> I was not aware of this particular FAQ but I have never had any problems
> with literal U+000A non-break spaces in my documents.. at least with
> html and pdfs generated via a2x.
Hi,
Yes, but it isn't guaranteed to work. The Unicode ability has
improved over the years, but IIUC asciidoc wasn't originally written
unicode aware and it doesn't use Python Unicode strings. In some
cases ordinary strings will successfully handle Unicode, but in some
cases it won't and thats why Python 3 changed such handling.
> --
> You received this message because you are subscribed to the Google Groups "asciidoc" group.
> To post to this group, send email to asciidoc@googlegroups.com.
> To unsubscribe from this group, send email to asciidoc+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/asciidoc?hl=en.
On Tue, Sep 04, 2012 at 07:59:18PM EDT, Lex Trotman wrote:
> On 5 September 2012 00:41, Chris Jones <cjns1...@gmail.com> wrote:
[..]
> > I was not aware of this particular FAQ but I have never had any
> > problems with literal U+000A non-break spaces in my documents.. at
> > least with html and pdfs generated via a2x.
> Yes, but it isn't guaranteed to work. The Unicode ability has
> improved over the years, but IIUC asciidoc wasn't originally written
> unicode aware and it doesn't use Python Unicode strings. In some
> cases ordinary strings will successfully handle Unicode, but in some
> cases it won't and thats why Python 3 changed such handling.
Now you mention it, I remember having to fiddle something in python
2.4's ./encoding directory when I wrote a unicode-oriented utility
a couple of years ago.
I had completely forgotten about it and whatever I did was only briefly
documented in whatever python module was involved... never bothered to
write a patch or anything.. and since I have upgraded to python 2.6,
I have no recollection of what I did at the time, and no way to find
out.. The only thing I remember is that the problem concerned using
non-ASCII literals in python scripts.
Although the problem appears to be similar, I had never thought of this
affecting asciidoc as well, especially since I do not remember having
any issues with non-breaking spaces (or other non-ASCII stuff) in
asciidoc documents.
Perhaps these aspects were addressed or worked around with python 2.6..?