Closed
Bug 1358541
Opened 9 years ago
Closed 7 years ago
tidylib outputs errors and generates full HTML docs
Categories
(developer.mozilla.org Graveyard :: Wiki pages, enhancement)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: jwhitlock, Unassigned)
References
Details
(Keywords: in-triage, Whiteboard: [specification][type:bug])
What did you do?
================
tidylib is run against revisions to standardize the HTML for useful diffs between document versions, and stores this in the 'tidied_content' field in the database.
What happened?
==============
tidylib often generates a UnicodeDecodeError with non-ASCII content, such as:
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe5 in position 0: unexpected end of data
This is reported to Sentry [1], and is the most common error with 873,000 events.
The content we are tidying is partial HTML, which tidylib converts to full HTML docs. The input:
<p>Hi.</p>
Is tidied to:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title></title>
</head>
<body>
<p>
Hi
</p>
</body>
</html>
This "wrapper" HTML sometimes is visible in diffs.
Finally, we do not appear to be specifying an input/output encoding. The default input encoding is ASCII, and the default output is latin-1.
[1] https://sentry.prod.mozaws.net/operations/mdn-prod/issues/222527/
What should have happened?
==========================
* Only legitimate encoding errors should raise exceptions
* The input and output should be UTF-8 encoded
* The wrapped HTML should be removed from the tidied output.
* Existing tidied content should be incrementally updated to the new standard.
* New revisions should be tidied before the diff is sent to Akismet, so that 'no content change' edits can be reliably detected and omitted (bug 1265495)
Is there anything else we should know?
======================================
We're using pytidylib 0.2.4. The latest is 0.3.2 [2]. An upgrade may be needed to get the latest, documented code.
The full tidylib options [3] include options such as char-encoding [4]. It should be reviewed for the best options for MDN content.
[2] https://github.com/countergram/pytidylib
[3] http://tidy.sourceforge.net/docs/quickref.html
[4] http://tidy.sourceforge.net/docs/quickref.html#char-encoding
Comment 1•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/kuma
https://github.com/mozilla/kuma/commit/6f160b8b83cef6f3b00ccc31e191e2a4826bd91d
bug 1358541: Demo significant whitespace in edits
Comment 2•9 years ago
|
||
Related to bug 1277311 at all?
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
Updated•6 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•