nxhtml doesn't recognize img as a single tag

Bug #1202482 reported by Mitch Deoudes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nXhtml
New
Undecided
Unassigned

Bug Description

My install (latest version) of nxhtml-mode isn't recognizing single tags without the final slash (<img src="foo" />), and is giving some odd validation errors besides. For instance, the following simple page produces the list of errors below:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" >
    <title>My First Bitstarter</title>
  </head>
  <body>

    <div >
      <img src="http://placehold.it/480x300" alt="placeholder" >
    </div>

  </body>
</html>

1. - both the meta and img tags trigger a "missing end-tag" error, which messes up indentation and validation of the elements that follow.
2. - I'm also getting a "Missing xmlns="http://www.w3.org/1999/xhtml"" error. Which I believe triggers quirks mode? Not sure why it's insisting on this.
3. - finally, it's giving me an "Attribute not allowed" error on the "charset" attr inside the meta tag.

I'll admit to being fairly new to web development & finding the long, winding road of the HTML spec relatively overwhelming... but the page validates as written at validator.w3.org, and googling indicates that the trailing slash is optional in HTML5.

emacs version: 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2013-04-14 on chindi10, modified by Debian

Output from nxhtml-report-bug is below. This is sort of confusing - there doesn't seem to be any debugging output. Is the idea just to make sure that people are reporting bugs without their own init enabled? (The above behavior was confirmed with no user init files.)

A lot of things can interfere with nXhtml/MuMaMo to cause bugs.
Therefore when reporting a bug please try to describe how to show it
without your own Emacs initializations. To do that start from

  M-x `emacs-Q-nxhtml'

If you want to find out if your initialization files interfere then
you can try the both test commands `nxhtmltest-run' and
`nxhtmltest-run-Q' and see if there is any difference.

You may also want to look at the installation part of the The Quick
Guide or the file nxhtml/readme.txt.

If you know Emacs lisp and are reporting a bug it would be nice if you
wrote a new unit test case. Please see the file nxhtmltest-suites.el
for examples.

There are several ways to report a bug, use the links below:
- By visiting URL `https://bugs.launchpad.net/nxhtml'.
- By email to Launchpad. This requires PGP signing the email and that
  you have told your PGP key to Launchpad.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.