-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Make escaping data in an HTML table optional #40
Comments
Hi, sounds like a good idea, would also solve things like kxxoling/PTable#15 in the fork. PR welcome! |
Yeah I believe it would. Really, it would be nice to be able to specify a transformation function for the data, with the default being your escape function. I've sub classed and written my own |
+1 for this, would like to be able to use HTML inside a cell (example below) |
👍 for this as well. My use case is nested html-rendered prettytables. If no one else is looking to jump on this, I might find some time in the nearish future. |
Asking if this feature is available already? I am trying to wrap values in one column with
Perhaps a switch or parameter to I tried Thanks |
Not yet, PRs welcome!
Yes, this is the original suggestion.
Yep, in general not a good idea to use functions beginning with an underscore, they're private/internal and liable to change or removal with no warning. |
Yup! Thanks! |
You can always apply a workaround, and monkeypatch the html module: import html
html.escape = lambda *args, **kwargs: args[0]
from prettytable import PrettyTable |
Amazing! |
For certain rows, I require the data to be augmented with HTML, and that unfortunately gets escaped here: https://github.com/jazzband/prettytable/blob/master/prettytable.py#L1622
Would you consider adding an option to get_html_string to disable data escaping?
Happy to contribute a PR
The text was updated successfully, but these errors were encountered: