Problem with table heading ending in a pipe

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

Problem with table heading ending in a pipe

bmomjian
With asciidoctor 1.5.2, if the last cell of a table heading ends with a pipe, the rendered HTML assumes the  first data row is part of the heading, e.g. this:

        [options="header",cols=">l,<l",frame="none"]
        |====
        ^l|stuff ^l|abc\|X
        |2 |hello\|
        |3 |hello
        |====

yields a correct HTML heading of:

        stuff   abc|X

which is good, but if you remove the "X" from the asciidoc heading, the
HTML output heading is:

        stuff   abc|2

The "X" is gone, but the "2" from the first data row is now in the
heading, and the first and only data row is now:

        hello|3  hello

This sure looks like a bug.  Other asciidoc rendering systems do not do this, e.g. https://asciidoclive.com/ .
Reply | Threaded
Open this post in threaded view
|

Re: Problem with table heading ending in a pipe

LightGuardjp
It looks like this is a bug in that it isn't escaping the pipe as it should (you have '\' before the pipe). Even when I add 'a' to cols it still isn't working ('a' tells asciidoctor to parse the contents of the cell as AsciiDoc).

Dan, thoughts? Seems like a legit bug to me.

On Tue, Mar 31, 2015 at 3:04 PM, bmomjian [via Asciidoctor :: Discussion] <[hidden email]> wrote:
With asciidoctor 1.5.2, if the last cell of a table heading ends with a pipe, the rendered HTML assumes the  first data row is part of the heading, e.g. this:

        [options="header",cols=">l,<l",frame="none"]
        |====
        ^l|stuff ^l|abc\|X
        |2 |hello\|
        |3 |hello
        |====

yields a correct HTML heading of:

        stuff   abc|X

which is good, but if you remove the "X" from the asciidoc heading, the
HTML output heading is:

        stuff   abc|2

The "X" is gone, but the "2" from the first data row is now in the
heading, and the first and only data row is now:

        hello|3  hello

This sure looks like a bug.  Other asciidoc rendering systems do not do this, e.g. https://asciidoclive.com/ .



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Problem-with-table-heading-ending-in-a-pipe-tp2902.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: Problem with table heading ending in a pipe

mojavelinux
Administrator
Actually, this is expected behavior. To include a pipe as content in a table cell, you have to use the {vbar} attribute. Asciidoctor does not honor escaped pipes in the table parsing code.


(if necessary, search for "To use a pipe")

@bmomjian is this what you are trying to do?

Please note that https://asciidoclive.com uses AsciiDoc Python and therefore may have different results than Asciidoctor. I recommend using something backed by Asciidoctor if you are looking for precisely the same output. We try to be as close to AsciiDoc Python as reasonable, but for some edge cases we've altered the parsing, one of which you are observing here.

-Dan

On Wed, Apr 1, 2015 at 1:44 AM, LightGuardjp [via Asciidoctor :: Discussion] <[hidden email]> wrote:
It looks like this is a bug in that it isn't escaping the pipe as it should (you have '\' before the pipe). Even when I add 'a' to cols it still isn't working ('a' tells asciidoctor to parse the contents of the cell as AsciiDoc).

Dan, thoughts? Seems like a legit bug to me.

On Tue, Mar 31, 2015 at 3:04 PM, bmomjian [via Asciidoctor :: Discussion] <[hidden email]> wrote:
With asciidoctor 1.5.2, if the last cell of a table heading ends with a pipe, the rendered HTML assumes the  first data row is part of the heading, e.g. this:

        [options="header",cols=">l,<l",frame="none"]
        |====
        ^l|stuff ^l|abc\|X
        |2 |hello\|
        |3 |hello
        |====

yields a correct HTML heading of:

        stuff   abc|X

which is good, but if you remove the "X" from the asciidoc heading, the
HTML output heading is:

        stuff   abc|2

The "X" is gone, but the "2" from the first data row is now in the
heading, and the first and only data row is now:

        hello|3  hello

This sure looks like a bug.  Other asciidoc rendering systems do not do this, e.g. https://asciidoclive.com/ .



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Problem-with-table-heading-ending-in-a-pipe-tp2902.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Problem-with-table-heading-ending-in-a-pipe-tp2902p2904.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: Problem with table heading ending in a pipe

bmomjian
Uh, I am not buying this explanation.   Asciidoctor clearly does honor escaped pipes in headings when it is not the last character, and in data lines, even if it is the last character, as shown in my example.  What is the logic that requires {vbar} in this case and not \|?

Also, I found this when adding asciidoc support to Postgres's 9.5 psql, so I don't have the option of having psql output something that is asciidoctor-specific, i.e. {vbar} is not recognized by asciidoc live.  
Reply | Threaded
Open this post in threaded view
|

Re: Problem with table heading ending in a pipe

mojavelinux
Administrator
My mistake! Looking at it closer, I now see that Asciidoctor is honoring the escaped pipes (maybe I fixed this at some point and forgot about it). However, when the escaped pipe appears at the end of the line, then the whole row just disappears. I can imagine what might be going wrong. It's holding out for another row, but doesn't find one. I agree that's a bug. Can you file an issue? I'll try to fix it for 1.5.3.

On Wed, Apr 1, 2015 at 7:04 PM, bmomjian [via Asciidoctor :: Discussion] <[hidden email]> wrote:
{vbar} is not recognized by asciidoc live.  

Not by default, but you can set it in the document header:

```
:vbar: |
```

However, it seems like we've identified the issue, so let's tackle it from that angle.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with table heading ending in a pipe

bmomjian
On Wed, Apr  1, 2015 at 10:17:36AM -0700, mojavelinux [via Asciidoctor :: Discussion] wrote:
> My mistake! Looking at it closer, I now see that Asciidoctor is honoring the
> escaped pipes (maybe I fixed this at some point and forgot about it). However,
> when the escaped pipe appears at the end of the line, then the whole row just
> disappears. I can imagine what might be going wrong. It's holding out for
> another row, but doesn't find one. I agree that's a bug. Can you file an issue?
> I'll try to fix it for 1.5.3.

Done.  I have opened a git issue on this:

        https://github.com/asciidoctor/asciidoctor.org/issues/370

--
  Bruce Momjian  <[hidden email]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +
Reply | Threaded
Open this post in threaded view
|

Re: Problem with table heading ending in a pipe

LightGuardjp
Mind moving (or closing and opening another issue) on asciidoctor/asciidoctor? asciidoctor.org is for the web site. Thanks!

On Wednesday, April 1, 2015, bmomjian [via Asciidoctor :: Discussion] <[hidden email]> wrote:
On Wed, Apr  1, 2015 at 10:17:36AM -0700, mojavelinux [via Asciidoctor :: Discussion] wrote:
> My mistake! Looking at it closer, I now see that Asciidoctor is honoring the
> escaped pipes (maybe I fixed this at some point and forgot about it). However,
> when the escaped pipe appears at the end of the line, then the whole row just
> disappears. I can imagine what might be going wrong. It's holding out for
> another row, but doesn't find one. I agree that's a bug. Can you file an issue?
> I'll try to fix it for 1.5.3.

Done.  I have opened a git issue on this:

        https://github.com/asciidoctor/asciidoctor.org/issues/370

--
  Bruce Momjian  <[hidden email]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Problem-with-table-heading-ending-in-a-pipe-tp2902p2926.html
To start a new topic under Asciidoctor :: Discussion, email <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;ml-node%2Bs49171n1h37@n6.nabble.com&#39;);" target="_blank">ml-node+s49171n1h37@...
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--

Reply | Threaded
Open this post in threaded view
|

Re: Problem with table heading ending in a pipe

bmomjian
Seems I opened the git issue in the wrong repository.  I have closed that and opened a new one:

   https://github.com/asciidoctor/asciidoctor/issues/1306
Reply | Threaded
Open this post in threaded view
|

Re: Problem with table heading ending in a pipe

mojavelinux
Administrator
In reply to this post by bmomjian
Thanks Bruce!

-Dan

On Wed, Apr 1, 2015 at 10:04 PM, bmomjian [via Asciidoctor :: Discussion] <[hidden email]> wrote:
On Wed, Apr  1, 2015 at 10:17:36AM -0700, mojavelinux [via Asciidoctor :: Discussion] wrote:
> My mistake! Looking at it closer, I now see that Asciidoctor is honoring the
> escaped pipes (maybe I fixed this at some point and forgot about it). However,
> when the escaped pipe appears at the end of the line, then the whole row just
> disappears. I can imagine what might be going wrong. It's holding out for
> another row, but doesn't find one. I agree that's a bug. Can you file an issue?
> I'll try to fix it for 1.5.3.

Done.  I have opened a git issue on this:

        https://github.com/asciidoctor/asciidoctor.org/issues/370

--
  Bruce Momjian  <[hidden email]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Problem-with-table-heading-ending-in-a-pipe-tp2902p2926.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: Problem with table heading ending in a pipe

bmomjian
In reply to this post by LightGuardjp
On Wed, Apr  1, 2015 at 01:42:38PM -0700, LightGuardjp [via Asciidoctor :: Discussion] wrote:
> Mind moving (or closing and opening another issue) on asciidoctor/asciidoctor?
> asciidoctor.org is for the web site. Thanks!

I have closed the item from asciidoctor.org and opened one in hopefully
the right git repository.  Thanks.

---------------------------------------------------------------------------


>
> On Wednesday, April 1, 2015, bmomjian [via Asciidoctor :: Discussion] <[hidden
> email]> wrote:
>
>     On Wed, Apr  1, 2015 at 10:17:36AM -0700, mojavelinux [via Asciidoctor ::
>     Discussion] wrote:
>     > My mistake! Looking at it closer, I now see that Asciidoctor is honoring
>     the
>     > escaped pipes (maybe I fixed this at some point and forgot about it).
>     However,
>     > when the escaped pipe appears at the end of the line, then the whole row
>     just
>     > disappears. I can imagine what might be going wrong. It's holding out for
>     > another row, but doesn't find one. I agree that's a bug. Can you file an
>     issue?
>     > I'll try to fix it for 1.5.3.
>
>     Done.  I have opened a git issue on this:
>
>             https://github.com/asciidoctor/asciidoctor.org/issues/370
>
>     --
>       Bruce Momjian  <[hidden email]>        http://momjian.us
>       EnterpriseDB                             http://enterprisedb.com
>
>       + Everyone has their own god. +
>
>
>     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
>     If you reply to this email, your message will be added to the discussion
>     below:
>     http://discuss.asciidoctor.org/
>     Problem-with-table-heading-ending-in-a-pipe-tp2902p2926.html
>     To start a new topic under Asciidoctor :: Discussion, email <a href=
>     "javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;
>     ml-node%[hidden email]&#39;);" target="_blank">
>     ml-node+s49171n1h37@...
>     To unsubscribe from Asciidoctor :: Discussion, click here.
>     NAML
>
>
>
> --
> Jason Porter
> http://en.gravatar.com/lightguardjp
>
>
>
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> If you reply to this email, your message will be added to the discussion below:
> http://discuss.asciidoctor.org/
> Problem-with-table-heading-ending-in-a-pipe-tp2902p2927.html
> To unsubscribe from Problem with table heading ending in a pipe, click here.
> NAML

--
  Bruce Momjian  <[hidden email]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +