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

Odd rendering of table #60

Closed
mathomp4 opened this issue Jan 12, 2020 · 7 comments · Fixed by #317
Closed

Odd rendering of table #60

mathomp4 opened this issue Jan 12, 2020 · 7 comments · Fixed by #317
Assignees
Labels
bug Something isn't working renderer Everything related to the markdown renderer

Comments

@mathomp4
Copy link

All,

First let me say I do love glow. Just learned about it recently and it's one less reason I don't need to spawn a browser when editing Markdown (which I'm still learning).

However, I noticed that for some reason a table of mine is rendering...oddly. And I don't know why. The file in question is this README.md. When I run it through glow, the entries for three of the rows have odd/different justification:
Screen Shot 2020-01-12 at 1 45 52 PM
I tried looking in vim with :set list on, but I don't see any odd characters in those rows. Any ideas on what I might have done?

@muesli
Copy link
Contributor

muesli commented Jan 12, 2020

It identifies 2.6, 2.20 and 1.16 as valid numbers, whereas all the other entries are considered strings. We will have to fix the table alignment.

@muesli muesli transferred this issue from charmbracelet/glow Jan 12, 2020
@muesli muesli added bug Something isn't working renderer Everything related to the markdown renderer labels Jan 12, 2020
@meowgorithm
Copy link
Member

meowgorithm commented Jan 12, 2020

To elaborate on @muesli’s comment, numbers align right by default, the same way they would in a spreadsheet. This is a great example of why that isn't always ideal!

@mathomp4
Copy link
Author

Ohhh. I see it. The others are all two-dot semver versions or just plain ol' strings. It's not like it hurts anything, but it just struck me as odd. 😄

@arl
Copy link
Contributor

arl commented Nov 11, 2020

#87 Hello there, great package here.

Is there an ETA for fixing this? I could help if that's something you'd like to see fix soon. I know I would :-)

@muesli
Copy link
Contributor

muesli commented Nov 11, 2020

I'm afraid I still haven't looked into it, so no ETA at this point. Help is always appreciated though!

@muesli
Copy link
Contributor

muesli commented Nov 11, 2020

To elaborate a bit more: currently we let the table renderer automatically detect column alignments, which is probably causing this issue. I think we should try to tackle this along with #65 and stick to a fixed alignment as specified in the markdown's table header.

@arl
Copy link
Contributor

arl commented Nov 11, 2020

Sounds great. Yes a fixed alignment would fix that. Later it could be improved with adding support to different alignments but for now, sticking with a consistent alignment, whatever it is, would do the trick.

caarlos0 added a commit that referenced this issue Jul 17, 2024
@caarlos0 caarlos0 self-assigned this Jul 17, 2024
caarlos0 added a commit that referenced this issue Jul 25, 2024
* wip

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* wip

* wip

* wip

* fix: autolink

closes #290

* fix: escape characters

closes #106
closes #274
closes #311

* fix: table

* ci: golangci lint update

* feat: use x/golden

* test: #106

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #290

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #312

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #257

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #149

* fix: #239

* feat: use lipgloss table

closes #262

Co-authored-by: bashbunni <bunni@bashbunni.dev>

* fix: codespan is not a block

* test: #315

* test: #316

* fix: #316

* test: table

* fix: codespans, tables

* test: table

* test: #117

* test: #60

* fix: rm stylewriter

* fix: #313

* fix: margin

* fix: blocks and word wrap

* fix: build

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* chore: gitattributes

* fix: test opt

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: stable lipgloss

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: double styles

* fix: tables

* fix: tables

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: bashbunni <bunni@bashbunni.dev>
bashbunni added a commit that referenced this issue Jul 31, 2024
* wip

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* wip

* wip

* wip

* fix: autolink

closes #290

* fix: escape characters

closes #106
closes #274
closes #311

* fix: table

* ci: golangci lint update

* feat: use x/golden

* test: #106

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #290

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #312

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #257

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #149

* fix: #239

* feat: use lipgloss table

closes #262

Co-authored-by: bashbunni <bunni@bashbunni.dev>

* fix: codespan is not a block

* test: #315

* test: #316

* fix: #316

* test: table

* fix: codespans, tables

* test: table

* test: #117

* test: #60

* fix: rm stylewriter

* fix: #313

* fix: margin

* fix: blocks and word wrap

* fix: build

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* chore: gitattributes

* fix: test opt

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: stable lipgloss

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: double styles

* fix: tables

* fix: tables

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: bashbunni <bunni@bashbunni.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working renderer Everything related to the markdown renderer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants