-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Improve/fix HTML rendering of tables #1528
Comments
At the moment the conversion doesn't actually render the content in to a html table, so its a conversion issue rather than simply adding some styling. |
Another example: https://www.whatdotheyknow.com/request/mental_health_services_4#incoming-601920 The original email has a nice looking HTML table. |
I would really welcome this fix/improvement. I submit a fair few FOI requests where I end up with incomprehensible tables. For example: https://www.whatdotheyknow.com/request/homeless_due_to_end_of_private_t_19#incoming-713565 As a result I usually write a reply asking that they email me the contents directly, which means others can't access the data if they happen across the request on the web site. |
Another example: https://www.whatdotheyknow.com/request/number_children_home_educated_wi What WhatDoTheyKnow shows:
Table in HTML: In this case we offered the user an image of the table and may upload the HTML version of the response and link it from an annotation: https://twitter.com/WhatDoTheyKnow/status/889469208383418368 |
Adding another example where a table provided in HTML format wasn't legible Also noting #4003 is a related, broader, ticket for preserving all HTML formatting in response emails. |
Had a quick play with that last night (used an older laptop so made the path to install harder for myself than it needed to be) and it looks interesting. I picked a random PDF attachment with a table in it (the first one I stumbled across) and it made a reasonable job of it, reducing the entire message to just the tabular content detail here. (But, as far as I can tell, it's only useful for tables stuck inside PDFs) |
https://github.com/adworse/iguvium – Ruby gem for extracting tables from PDF as a structured info |
I've come across this recently with tables of data pasted into response emails and then rendered unintelligible by the conversion. It looks as if most of the examples above are HTML tables that get mangled, so that seems like a good place to focus. Parsing tables out of PDFs is a whole separate challenge in itself (I've been doing this a lot recently ...) and there are plenty of products/libraries out there that (attempt to) do this - Camelot, PDFTables.com, Tabula etc. Is there any reason you couldn't give people access to the raw response? That would give people the ability to copy-paste the table direct into a spreadsheet or just to eyeball it. |
+1 another example at https://www.whatdotheyknow.com/request/tenancies_ended_by_death_of_the#incoming-1455601 |
A WhatDoTheyKnow user writes:
|
+1 from me following the poor formatting of the table at https://www.whatdotheyknow.com/request/potholes_rights_of_way_maintenan The WDTK admin team have provided the user with a copy of the raw email. |
+1 The data has been copied to a Google sheet linked from an annotation. |
Sometimes we manually convert these for pro users on request. Process is: Download raw email > open in apple mail > copy and paste into text edit (to preserve rich text formatting) > make any redactions > print as pdf > upload file > link in annotation. |
+1 https://www.whatdotheyknow.com/request/vser_payments_teaching_staff#incoming-1938493 Data supplied to user by email, and made available via Google Sheets |
+1 The response here is almost illegible |
Wondering whether we can convert the main body HTML part to PDF and add it as an "attachment" or similar, so that:
Would have to consider possible extra work when it comes to hiding and censor rules though. |
This issue (alongside, perhaps, #4578) has actually been cited in an FOI response:
https://www.whatdotheyknow.com/request/docs_21#incoming-1517708 |
Another example on this request. The table in the raw email actually looks like this:
|
Just to add to the above, this seems like one of the few areas WhatDoTheyKnow is less useful than the user just sending an email. Is making the original email available as a download just to the requester an option? |
Classifying requests on WhatDoTheyKnow reveals lots more examples that we're not logging or acting on; often the lack of formatting doesn't prevent accessing the information with care and effort, but it does make it less easy to read than intended. |
If we did this for all incoming messages it would become another thing to check to see if redactions had worked on when putting censor rules in place. We probably shouldn't do it retrospectively, not without careful consideration, as we might end up publishing lots of new material. We could do it on a per-request basis, but that wouldn't help as significantly. Could we detect a table, and present it in HTML form at the end of a message in a similar way as we extract some links/references and present them at the end? |
Just for ref, the problem I was looking at was a request where some cells were blank, making it hard to easily read or convert the table when it got flattened. Automated approaches might move values around in this case so would need to be extracted from the html version rather than the text (but that's probably possible?) Could extract all table elements and make new attachments from them as a reduced version of Gareth's pdf idea above. A recurring problem seems to be that pulling content out of the html is creating extra problems for redaction. Could just have an approach of deleting any derived attachments if a change is applied as a way of balancing the big benefit in many cases with tables? Those requests would just end up like all requests are at the moment. Email downloads might not be the right answer in this case, but do censor rules matter as much if just available to the original requester? Feel like giving people the option of all the content they'd have got by email is good. This is especially in terms of the case for pro vs email. But can take that to another issue. |
I think we want to solve this issue for all readers, not specifically requesters. If we manually act in these cases we don't just provide the readable table to the requester we also publish it. Making the material available to the requester easily/automatically might stop them contacting us, prompting us to make the material available to all. It might make the issue from the point of view of the non-requester reader, worse.
I think that's very similar to the proposal of extracting the table and presenting it on the request page. A separate page / "generated attachment" might be preferable though due to the risk of formatting being disrupted by a large table. As with "view as HTML" we'd want a header linking back to the request page. |
Yes. Though not the main use, sometimes they are in place to keep information from the requester. We would have to be extremely careful. |
Another example here: https://www.whatdotheyknow.com/request/scaffolding_contractors_used_by#incoming-2126200 The FOI officer noticed and provided the data as a spreadsheet. |
+1 This is almost unreadable: https://www.whatdotheyknow.com/request/sexual_orientation_workforce_dat_113#incoming-1850225 |
+1 An authority have contacted us because they are unhappy about the way that a response that they have provided is displaying. The table in the email got mangled by the system. |
Here is another example where it is difficult to read. Here, the pipe separators that you sometimes see aren't present: |
In the admin view for the main body part (#7999) I used e.g. https://www.whatdotheyknow.com/request/foi_request_modern_slavery_train_13#incoming-2502777 → https://www.whatdotheyknow.com/admin/attachments/4466504/edit |
+1 An authority has contacted us to complain that our mangling of their response has damaged the reputation of the information governance team. |
+1 This continues to be a frequent source of user support. It must be particulalry frustrating for pro users to have to write to us again and again about multiple issues in the same batch when they are paying for the service. |
This is desirable, but unlikely to be worked on in the next 12 months so closing for now. |
e.g http://www.whatdotheyknow.com/request/it_support_services_1295#incoming-258044
http://www.whatdotheyknow.com/request/it_support_services_347#incoming-258014
http://www.whatdotheyknow.com/request/it_support_services_1236#incoming-257000
taken from #18 by @hsenag
The text was updated successfully, but these errors were encountered: