-
Notifications
You must be signed in to change notification settings - Fork 222
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
Comments
Looks like updating showdown and adding the github and table extensions will do the trick. I'll look into it. |
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. |
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. |
Thanks for the feedback, saves me from having to try it myself :) |
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 |
Yes. You can contact me by mail, is in my github profile |
Generally Markdown rendering should be improved. |
@maniac103 what's the status on this? Is the mentioned repository available somewhere? |
@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. |
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. |
I found a library that implements something similar to what I described: https://github.com/SufficientlySecure/html-textview#support-for-html-tables |
For now, a line break after each row and a space between cells would already help. |
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) |
Managed to get it to compile. Here is how it looks for this comment: |
Hello, any news on this ? Thanks |
I think it works now |
Nope, not working on v4.6.10 |
At least it exists, not very correct but still readable |
Github Flavored Markdown has a nice syntax for tables, but the app does not support it.
Example
cell
cell
cell
The text was updated successfully, but these errors were encountered: