weird translation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

weird translation

worldwidewilly
Not sure wherein the problem lies. I created a style guide and posted it to my github account. The very last line of asciidoc - which follows a blank line is:

J. B. Rainsberger states something very similar to the above at http://junit.org/faq.html#atests_15.

This is followed by another blank line. On github, and also in the Atom asciidoc preview - the J. is rendered as A. It appears to be the beginning of a list. It is unclear to me why that would happen. I suppose I could escape it somehow. Better would be not to have to worry about starting a list when the line begins with an initial. Suggestions?
Reply | Threaded
Open this post in threaded view
|

Re: weird translation

jvdh
yes, the same thing happens in the original (python)-asciidoc. there might be other solutions (to change the configuration in such a way that `J. Doe'  at the beginning of a line is not taken to be a list entry), but I have settled on simply inserting a zero-width space in front.  there is a predefined attribute ':zwsp:' for this:

{zwsp}J. Doe

then, does what you want, I think.

regards,

joerg
Reply | Threaded
Open this post in threaded view
|

Re: weird translation

mojavelinux
Administrator
As joerg points out, the problem here is that the processor is recognizing "J. " as the start of a list item. It's a shorthand in AsciiDoc for the following:

1. defining a numbered list
2. setting the numeration type to upperalpha
3. setting the offset to J*

* I checked and (3) doesn't actually work. Instead, it issues a warning about the list item index.

I really had to think about it when I first saw it (before joerg's reply), which tells me that this is a very obscure feature in AsciiDoc that we should consider dropping. In fact, I forgot it was even possible to define a list this way.

It's best to proceed by opening a new issue in Asciidoctor core so that we can discuss. https://github.com/asciidoctor/asciidoctor/issues

Another workaround is to use an attribute for the space after the J.

J.{sp}B. Rainsberger

You just need to put in something that is going to interrupt the parser.

Cheers,

-Dan

On Sun, Jun 14, 2015 at 12:14 PM, jvdh [via Asciidoctor :: Discussion] <[hidden email]> wrote:
yes, the same thing happens in the original (python)-asciidoc. there might be other solutions (to change the configuration in such a way that `J. Doe'  at the beginning of a line is not taken to be a list entry), but I have settled on simply inserting a zero-width space in front.  there is a predefined attribute ':zwsp:' for this:

{zwsp}J. Doe

then, does what you want, I think.

regards,

joerg


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/weird-translation-tp3381p3382.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: weird translation

worldwidewilly
@joerg  and @dan

Sorry for taking so long to get back to this. Both solutions worked, as expected. Thanks for the help. After reading Dan's comments, I do recall reading some documentation that backed up the way this was interpreted. It does seem counter-intuitive to me, however, as lists normally start with a dot. I don't expect the api to change, but I feel something more like:

.J.

would be a more obvious way to start a list with a given enumeration.

@dan

You mentioned putting this on the asciidoctor issues list. I have no doing this. Was it your intention that I do so? And, if so, are you suggesting that I point out that item 3 in your list fails. Or, do you think what I stated above should be included? Obviously, this would be a breaking change, so I doubt that it would go very far.

bill
mojavelinux wrote
As joerg points out, the problem here is that the processor is recognizing
"J. " as the start of a list item. It's a shorthand in AsciiDoc for the
following:

1. defining a numbered list
2. setting the numeration type to upperalpha
3. setting the offset to J*

* I checked and (3) doesn't actually work. Instead, it issues a warning
about the list item index.

I really had to think about it when I first saw it (before joerg's reply),
which tells me that this is a very obscure feature in AsciiDoc that we
should consider dropping. In fact, I forgot it was even possible to define
a list this way.

It's best to proceed by opening a new issue in Asciidoctor core so that we
can discuss. https://github.com/asciidoctor/asciidoctor/issues

Another workaround is to use an attribute for the space after the J.

J.{sp}B. Rainsberger

You just need to put in something that is going to interrupt the parser.

Cheers,

-Dan

On Sun, Jun 14, 2015 at 12:14 PM, jvdh [via Asciidoctor :: Discussion] <
[hidden email]> wrote:

> yes, the same thing happens in the original (python)-asciidoc. there might
> be other solutions (to change the configuration in such a way that `J. Doe'
>  at the beginning of a line is not taken to be a list entry), but I have
> settled on simply inserting a zero-width space in front.  there is a
> predefined attribute ':zwsp:' for this:
>
> {zwsp}J. Doe
>
> then, does what you want, I think.
>
> regards,
>
> joerg
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
> http://discuss.asciidoctor.org/weird-translation-tp3381p3382.html
>  To start a new topic under Asciidoctor :: Discussion, email
> [hidden email]
> To unsubscribe from Asciidoctor :: Discussion, click here
> <http://discuss.asciidoctor.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=ZGFuLmouYWxsZW5AZ21haWwuY29tfDF8MTY5MzI5MDU4>
> .
> NAML
> <http://discuss.asciidoctor.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



--
Dan Allen | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: weird translation

mojavelinux
Administrator

On Fri, Jun 19, 2015 at 9:30 AM, worldwidewilly [via Asciidoctor :: Discussion] <[hidden email]> wrote:
You mentioned putting this on the asciidoctor issues list.

This has since been reported. Turns out, we have the same problem with numbers.


Some solution have been proposed in that thread. I've also added your proposal and linked to this thread.

Cheers,

-Dan

--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen