Skip to content

Commit

Permalink
HTML validation
Browse files Browse the repository at this point in the history
- microdata (itemscope, itemprop, etc) are not valid in html4, but they are in html5 ==> changed doctype
- there was a typo on "Content-Style-Stype" ==> changed to "Content-Style-Type" (even though I'm not sure we need meta http-equiv anymore)
- the "alt" attribute on images is mandatory ==> added the attribute, although it's still empty (this is still valid): I don't know how to grab the title of the recipe, for now
  • Loading branch information
Lamecarlate committed Aug 2, 2015
1 parent d194907 commit 4a89756
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gourmet/plugins/import_export/html_plugin/html_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from gourmet import convert,gglobals
from gourmet.exporters.exporter import ExporterMultirec, exporter_mult

HTML_HEADER_START = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
HTML_HEADER_START = """<!DOCTYPE html>
<html>
<head>
"""
HTML_HEADER_CLOSE = """<meta http-equiv="Content-Style-Stype" content="text/css">
HTML_HEADER_CLOSE = """<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>"""

Expand Down Expand Up @@ -88,7 +88,7 @@ def write_image (self, image):
o.write(image)
o.close()
# we use urllib here because os.path may fsck up slashes for urls.
self.out.write('<img src="%s" itemprop="image">'%self.make_relative_link("%s%s.jpg"%(self.imagedir,
self.out.write('<img src="%s" itemprop="image" alt="">'%self.make_relative_link("%s%s.jpg"%(self.imagedir,
self.imgcount)
)
)
Expand Down

0 comments on commit 4a89756

Please sign in to comment.