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

Add support for GFM tables #237

Open
eush77 opened this issue Feb 5, 2015 · 20 comments
Open

Add support for GFM tables #237

eush77 opened this issue Feb 5, 2015 · 20 comments
Assignees

Comments

@eush77
Copy link

eush77 commented Feb 5, 2015

Github Flavored Markdown has a nice syntax for tables, but the app does not support it.

Example

Centered Left aligned Right aligned Not aligned
cell cell cell cell
cell cell cell cell
cell cell cell cell
@maniac103
Copy link
Collaborator

Looks like updating showdown and adding the github and table extensions will do the trick. I'll look into it.

@maniac103 maniac103 self-assigned this May 25, 2015
@maniac103
Copy link
Collaborator

Thinking about it, that will likely only help for watching markdown files though. For e.g. issues and issue comments, we're using preformatted HTML provided by Github. It's possible that Android's TextViews don't support showing tables though.

EDIT: That indeed is the problem. Gitskarios gets away with that by using a WebView for each comment and the description, but I'm not sure how this will perform on lower end phones and/or issues with a lot of comments.

@alorma
Copy link

alorma commented May 25, 2015

Heyb

I used a webview to show the comments, but it get really really bad performance.

I switched to your Html > Textview way, but now i can't show tables neither.

Time ago, i made a plugin on Html.class, to manage the tables, i will find, apply to gitskarios, and try to make a PR.

@maniac103
Copy link
Collaborator

Thanks for the feedback, saves me from having to try it myself :)

@alorma
Copy link

alorma commented May 25, 2015

Hey @maniac103 , i add you to a Private Repository, where i pushed the base class i did long time ago.

It's just the classes.

I will work on that and try to adapt with yours

@maniac103
Copy link
Collaborator

Thanks again :) It works, but needs some work:
screenshot_2015-05-25-14-09-55

Most complicated part that I can see is getting the TextView width into the span, as I don't think the assumption that TextView width = screen width holds in all cases.

Are you in some IRC channel, Hangouts or something to discuss this?

@alorma
Copy link

alorma commented May 25, 2015

Yes.

You can contact me by mail, is in my github profile

@julkue
Copy link

julkue commented Mar 12, 2016

Generally Markdown rendering should be improved.

@Tunous
Copy link
Collaborator

Tunous commented Apr 2, 2017

@maniac103 what's the status on this? Is the mentioned repository available somewhere?

@maniac103
Copy link
Collaborator

@Tunous I have a diff lying around somewhere. I'll see whether I can dig it up. In general, the problem is that we need to render the table in one span, and I'm not sure what the best way of creating a span that fills the whole TextView width is.

@Tunous
Copy link
Collaborator

Tunous commented Apr 2, 2017

Got the diff and now that I look at it I think it might be a better idea to try a different solution. There are just too many factors in play and with limited width the tables will mostly just not fit. Or if we do text wrapping they will look off.

The solution I propose would be to change tables to clickable links that open a pop-up with the table in WebView instead. I saw it done like this somewhere but can't remember where now. It's not an ideal solution but it should be easy to add and will work much better than TextView span.

@Tunous
Copy link
Collaborator

Tunous commented Apr 13, 2017

I found a library that implements something similar to what I described: https://github.com/SufficientlySecure/html-textview#support-for-html-tables

peek 2017-04-13 21-08

@Crissov
Copy link

Crissov commented Aug 2, 2017

For now, a line break after each row and a space between cells would already help.

@Tunous
Copy link
Collaborator

Tunous commented Oct 28, 2017

I have found a way to implement this. See this repository with proof of concept implementation. You can compile and run sample app from here.

It's done by parsing comment HTML and splitting it into multiple blocks. Then each of these blocks gets its own view (HorizontalScrollView, TableLayout) based on its tag (table, pre). It works surprisingly well and just has one limitation where HTML code must be flattened to work correctly. (Though that probably could be fixed if needed)

@maniac103

@Tunous
Copy link
Collaborator

Tunous commented Oct 30, 2017

Managed to get it to compile. Here is how it looks for this comment:

markdown

@AntumDeluge
Copy link

AntumDeluge commented Jun 22, 2021

Glad this has been pointed out. Hope it gets implemented soon. Looks like it has been a few years since someone has commented.

Edit: Here is what table looks like on my system (OctoDroid v4.6.5):

Screenshot_20210622-010533_OctoDroid

Here is what it looks like in browser:

Screenshot_20210622-010543_Chrome

@KaKi87
Copy link

KaKi87 commented Aug 27, 2021

Hello, any news on this ? Thanks

@Secret-chest
Copy link

I think it works now

@KaKi87
Copy link

KaKi87 commented Aug 19, 2023

Nope, not working on v4.6.10

@Secret-chest
Copy link

At least it exists, not very correct but still readable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants