Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in printing tables between 0.7.9 and master #56

Closed
ericonr opened this issue Feb 7, 2021 · 6 comments
Closed

Regression in printing tables between 0.7.9 and master #56

ericonr opened this issue Feb 7, 2021 · 6 comments

Comments

@ericonr
Copy link

ericonr commented Feb 7, 2021

I was unable to git bisect this, because a few commits were simply not printing anything.

From the following markdown:

# Mirrors

| Repository                                     | Location         |
|------------------------------------------------|------------------|
| https://alpha.de.repo.voidlinux.org/         | EU: Finland      |
| <https://mirrors.servercentral.com/voidlinux/> | USA: Chicago     |
| <https://alpha.us.repo.voidlinux.org/>         | USA: Kansas City |
| <https://mirror.clarkson.edu/voidlinux/>       | USA: New York    |

Using ./lowdown -s -Tman mirrors.md; with -Tms on master it's broken in the same way, and on 0.7.9 it's broken in a weirder way still.

With lowdown 0.7.9, I get:

.TH "Untitled article" 7
.SH Mirrors
.TS
tab(|) expand allbox;
lb lb
l l.
T{
Repository
T}|T{
Location
T}
T{
\f[I]https://alpha.de.repo.voidlinux.org/\f[R]

T}|T{
EU: Finland
T}
T{
\f[I]https://mirrors.servercentral.com/voidlinux/\f[R]

T}|T{
USA: Chicago
T}
T{
\f[I]https://alpha.us.repo.voidlinux.org/\f[R]

T}|T{
USA: Kansas City
T}
T{
\f[I]https://mirror.clarkson.edu/voidlinux/\f[R]

T}|T{
USA: New York
T}
.TE

and with lowdown from master, I get:

.\" -*- mode: troff; coding: utf-8 -*-
.TH "Untitled article" "7" ""
.SH Mirrors
.TS
tab(|) expand allbox;
lb lb
l l.
T{
Repository
T}
|
T{
Location
T}
T{
\fIhttps://alpha.de.repo.voidlinux.org/\fR
T}
|
T{
EU: Finland
T}
T{
\fIhttps://mirrors.servercentral.com/voidlinux/\fR
T}
|
T{
USA: Chicago
T}
T{
\fIhttps://alpha.us.repo.voidlinux.org/\fR
T}
|
T{
USA: Kansas City
T}
T{
\fIhttps://mirror.clarkson.edu/voidlinux/\fR
T}
|
T{
USA: New York
T}
.TE

With the first one, I get a normal looking table without any issues, but the latter generates a completely broken table (I'm displaying them with mandoc(1)).

kristapsdz added a commit that referenced this issue Feb 8, 2021
…T}, the

former of which must continue from a previous line and the latter which must
have content continue on it.  Fix the current source by having T{ be a span
macro (as what comes before that will be a T}) and have the T{ be a special
snowflake that starts on its own line, but allows continuing content.

References #56
@kristapsdz
Copy link
Owner

Great find! In the first example (with old lowdown), it's just luck that it works: blank lines in the output are the reason I re-wrote the serialisation algorithm to be two-pass. And as you can see, this is mostly due to links.

The referenced patch fixes this. Tested in a variety of situations with embedded links, links in styles, etc.

If you can confirm this fix, please close the issue. Thank you for reporting!

@ericonr
Copy link
Author

ericonr commented Feb 8, 2021

The -Tman output now looks fine, but the -Tms output is quite broken still... Do you want to repurpose this issue for that?

┌─────────────────────────────────────┬──────────────────┐
│Repository                           │ Location         │
├─────────────────────────────────────┼──────────────────┤
│W -D                                 │ EU: Finland      │
│https://alpha.de.repo.voidlinux.org/ │                  │
│https://alpha.de.repo.voidlinux.org/ │                  │
├─────────────────────────────────────┼──────────────────┤
│                                     │ USA: Chicago     │
├─────────────────────────────────────┼──────────────────┤
│                                     │ USA: Kansas City │
├─────────────────────────────────────┼──────────────────┤
│                                     │ USA: New York    │
└─────────────────────────────────────┴──────────────────┘

Thanks for the quick fix!

Edit: I accidentally typed inside the code block.

@kristapsdz
Copy link
Owner

kristapsdz commented Feb 8, 2021

I can't replicate this. What are the exact commands you're using, and what version of groff? (Thanks for keeping at this!)

@ericonr
Copy link
Author

ericonr commented Feb 8, 2021

You'll see an edit above, I had accidentally typed a bit inside the code block.

I'm running ./lowdown -s -Tms mirrors.md |mandoc, with mandoc 1.14.5.

@kristapsdz
Copy link
Owner

That's the problem---mandoc doesn't accept ms macros, only man.

@ericonr
Copy link
Author

ericonr commented Feb 9, 2021

Ok, sorry for the confusion. Should be all good now, thank you very much :)

@ericonr ericonr closed this as completed Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants