Title: HTMLSerializer and HTML entities · Issue #197 · html5lib/html5lib-python · GitHub
Open Graph Title: HTMLSerializer and HTML entities · Issue #197 · html5lib/html5lib-python
X Title: HTMLSerializer and HTML entities · Issue #197 · html5lib/html5lib-python
Description: >>> html5lib.serializer.serialize(html5lib.parse('
')) '
\xa0' at the moment the parsing and serialising a document causes entities to be converted into special characters, including things like #00 and there is no way to p...
Open Graph Description: >>> html5lib.serializer.serialize(html5lib.parse('
')) '
\xa0' at the moment the parsing and serialising a document causes entities to be converted into special characters, including ...
X Description: >>> html5lib.serializer.serialize(html5lib.parse('<p> </p>')) '<p>\xa0' at the moment the parsing and serialising a document causes entities to b...
Opengraph URL: https://github.com/html5lib/html5lib-python/issues/197
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"HTMLSerializer and HTML entities","articleBody":"``` python\n\u003e\u003e\u003e html5lib.serializer.serialize(html5lib.parse('\u003cp\u003e\u0026nbsp;\u003c/p\u003e'))\n'\u003cp\u003e\\xa0'\n```\n\nat the moment the parsing and serialising a document causes entities to be converted into special characters, including things like #00 and there is no way to pass additional entities to xml.sax.saxutils.escape.\n\nI looked into subclassing the serialiser but the escaping happens in the middle of the serialize() method at:\n\nhttps://github.com/html5lib/html5lib-python/blob/master/html5lib/serializer/htmlserializer.py#L223 \n\nperhaps the class should define an entities dict to pass through the standard html5 entities and special characters or do the escaping via a class method that can be overridden?\n","author":{"url":"https://github.com/danielknell","@type":"Person","name":"danielknell"},"datePublished":"2015-07-20T21:32:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/197/html5lib-python/issues/197"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e9e02b85-6e2d-502b-545b-aef1e87224e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E048:8E09A:68563C:92A0AD:6970AEDA |
| html-safe-nonce | addafb852ca8f12c490af6ca0876263ab005d9d2404e3ec7187ff321601be91b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDQ4OjhFMDlBOjY4NTYzQzo5MkEwQUQ6Njk3MEFFREEiLCJ2aXNpdG9yX2lkIjoiNzQ1NTYwNzMxNjg0NjUyMjA3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 24a9ab252f2c190d53a554aac67c7ec5ecdee2d1c7d9f328467e9d74cf226769 |
| hovercard-subject-tag | issue:96165790 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/html5lib/html5lib-python/197/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c63b31c6b6f6f625d33d1270a84046083243759505fdb72c28d56730794681b/html5lib/html5lib-python/issues/197 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c63b31c6b6f6f625d33d1270a84046083243759505fdb72c28d56730794681b/html5lib/html5lib-python/issues/197 |
| og:image:alt | >>> html5lib.serializer.serialize(html5lib.parse(' ')) ' \xa0' at the moment the parsing and serialising a document causes entities to be converted into special characters, including ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | danielknell |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8e0be80373b724b033cdf8a7b1f78bf5fb6a5d7a2182a9a403aa30894606e390 |
| turbo-cache-control | no-preview |
| go-import | github.com/html5lib/html5lib-python git https://github.com/html5lib/html5lib-python.git |
| octolytics-dimension-user_id | 4092973 |
| octolytics-dimension-user_login | html5lib |
| octolytics-dimension-repository_id | 9322649 |
| octolytics-dimension-repository_nwo | html5lib/html5lib-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 9322649 |
| octolytics-dimension-repository_network_root_nwo | html5lib/html5lib-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b8714db0002cf78dc2d2566571807e404d6cb817 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width