Consider this custom query:
https://fivethirtyeight.datasettes.com/fivethirtyeight-5de27e3?sql=select+user%2C+%28%27https%3A%2F%2Ftwitter.com%2F%27+%7C%7C+user%29+as+user_url%2C+created_at%2C+text%2C+url+from+%5Btwitter-ratio%2Fsenators%5D+limit+10%3B
select user, ('https://twitter.com/' || user) as user_url, created_at, text, url from [twitter-ratio/senators] limit 10;

It would be nice if these URLs were turned into links, as happens on the table view page: https://fivethirtyeight.datasettes.com/fivethirtyeight-5de27e3/twitter-ratio%2Fsenators

This currently does not happen because the table view render logic takes a different path through display_columns_and_rows() which includes this bit:
|
elif value is None: |
|
display_value = jinja2.Markup(" ") |
|
elif is_url(str(value).strip()): |
|
display_value = jinja2.Markup( |
|
'<a href="{url}">{url}</a>'.format( |
|
url=jinja2.escape(value.strip()) |
|
) |
|
) |
Consider this custom query:
https://fivethirtyeight.datasettes.com/fivethirtyeight-5de27e3?sql=select+user%2C+%28%27https%3A%2F%2Ftwitter.com%2F%27+%7C%7C+user%29+as+user_url%2C+created_at%2C+text%2C+url+from+%5Btwitter-ratio%2Fsenators%5D+limit+10%3B
select user, ('https://twitter.com/' || user) as user_url, created_at, text, url from [twitter-ratio/senators] limit 10;It would be nice if these URLs were turned into links, as happens on the table view page: https://fivethirtyeight.datasettes.com/fivethirtyeight-5de27e3/twitter-ratio%2Fsenators
This currently does not happen because the table view render logic takes a different path through
display_columns_and_rows()which includes this bit:datasette/datasette/views/table.py
Lines 195 to 202 in b0a95da