GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Rudimentary table support by seato · Pull Request #33 · SufficientlySecure/html-textview

This repository was archived by the owner on Sep 7, 2020. It is now read-only.

Conversation

@seato

@seato seato commented Feb 23, 2016

Copy link
Copy Markdown
Contributor

This PR adds an imperfect workaround for adding table support by adding two spans: ClickableTableSpan and DrawTableLinkSpan.

These spans provide limited table support by reconstructing the HTML and passing it to an app-defined implementation of ClickTableSpan (which could possibly forward it to a WebView similar to what's shown in the example).

The DrawTableSpan does not need to be implemented, but we expose it so that applications can display text other than "[tap for table]", which is useful for localization.

This PR is imperfect because once we start keeping track of a table tag, we are only able to keep track of other tags which android doesn't handle by default, so the raw html passed to the ClickableTableSpan won't necessarily be correct.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@seato seato mentioned this pull request Feb 23, 2016
Supporting HTML table tag #34
Closed
@seato

seato commented Feb 23, 2016

Copy link
Copy Markdown
Contributor Author

If this looks good to merge, then I'll add a commit to update the README to reflect table support.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seato

seato commented Feb 23, 2016

Copy link
Copy Markdown
Contributor Author

Also if it looks good, I'll add the proper Apache headers. I just realized I left them off.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dschuermann

dschuermann commented Feb 23, 2016

Copy link
Copy Markdown
Member

Yes looks okay, I think that the usefulness is limited but I am willing to merge :)

Please add the license headers and README additions as you proposed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seato
seato force-pushed the html-table-support branch from c5b676e to d77bf1f Compare February 23, 2016 17:50
@seato

seato commented Feb 23, 2016

Copy link
Copy Markdown
Contributor Author

@dschuermann Applied the changes we discussed; I also increased the version in the build and README to 1.4 but I didn't update the tag because I see it's at v1.4 so I'm not sure what kind of system we've got going on there.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seato

seato commented Feb 23, 2016

Copy link
Copy Markdown
Contributor Author

@dschuermann What should happen if the HtmlTextView encounters a table but the developer doesn't implement a ClickableTableSpan?

ATM I provide a default implementation for DrawTableLinkSpan which means <table>...</table> gets replaced with [tap for table] (unless the dev provides their own implementation), but tapping the text does nothing.

There's two routes we could go about this:

  1. Provide a default implementation for ClickableTableSpan which crashes if the HtmlTextView comes across a table and the user/dev clicks the replacement text.
  2. Crash in HtmltextView.setHtmlFromString() which is pretty early so that it developers don't miss it.

I like the idea of crashing early so that devs don't get caught with their pants down, but I can also do what you do with image getters and just log an error. Thoughts?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dschuermann

dschuermann commented Feb 23, 2016

Copy link
Copy Markdown
Member

I think currently, every tag that is not supported is simply not displayed. I would propose we do the same for tables if no ClickableTableSpan has been given and simply omit the whole table, even not showing [tap for table].

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seato
Html Tag Handler can handle basic tables by storing the HTML to be la…
7baea7b
…ter used by a ClickTableSpan. Applications wanting to take advantage of this capability need to implement a ClickTableSpan and do whatever they'd like with the raw HTML (i.e. pass it into a webview).

In addition, a DrawTableSpan has been provided for applications that want to display text other than "[tap for table]", which should be useful for localization.
@seato
seato force-pushed the html-table-support branch from d77bf1f to 7baea7b Compare February 23, 2016 22:17
@seato

seato commented Feb 23, 2016

Copy link
Copy Markdown
Contributor Author

@dschuermann Updated the PR and the default behavior is to not render the tables.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dschuermann added a commit that referenced this pull request Feb 23, 2016
@dschuermann
Merge pull request #33 from seato/html-table-support
17972e2
Rudimentary table support
@dschuermann
dschuermann merged commit 17972e2 into SufficientlySecure:master Feb 23, 2016
@dschuermann

dschuermann commented Feb 23, 2016

Copy link
Copy Markdown
Member

thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dschuermann

dschuermann commented Feb 23, 2016

Copy link
Copy Markdown
Member

and released to jcenter...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@seato @dschuermann
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.