source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: First steps in HTML5: use UTF8 meta-charset and HTML5 doctype
Date: Sat, 27 Sep 2014 04:54:34 -0400 (EDT)	[thread overview]
Message-ID: <201409270854.s8R8sYm6004271@krisdoz.my.domain> (raw)

Log Message:
-----------
First steps in HTML5: use UTF8 meta-charset and HTML5 doctype identifier.

Modified Files:
--------------
    mdocml:
        html.c
        html.h

Revision Data
-------------
Index: html.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -Lhtml.h -Lhtml.h -u -p -r1.54 -r1.55
--- html.h
+++ html.h
@@ -68,6 +68,7 @@ enum	htmlattr {
 	ATTR_SUMMARY,
 	ATTR_ALIGN,
 	ATTR_COLSPAN,
+	ATTR_CHARSET,
 	ATTR_MAX
 };
 
Index: html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -Lhtml.c -Lhtml.c -u -p -r1.163 -r1.164
--- html.c
+++ html.c
@@ -91,6 +91,7 @@ static	const char	*const htmlattrs[ATTR_
 	"summary", /* ATTR_SUMMARY */
 	"align", /* ATTR_ALIGN */
 	"colspan", /* ATTR_COLSPAN */
+	"charset", /* ATTR_CHARSET */
 };
 
 static	const char	*const roffscales[SCALE_MAX] = {
@@ -193,17 +194,9 @@ print_gen_head(struct html *h)
 {
 	struct htmlpair	 tag[4];
 
-	tag[0].key = ATTR_HTTPEQUIV;
-	tag[0].val = "Content-Type";
-	tag[1].key = ATTR_CONTENT;
-	tag[1].val = "text/html; charset=utf-8";
-	print_otag(h, TAG_META, 2, tag);
-
-	tag[0].key = ATTR_NAME;
-	tag[0].val = "resource-type";
-	tag[1].key = ATTR_CONTENT;
-	tag[1].val = "document";
-	print_otag(h, TAG_META, 2, tag);
+	tag[0].key = ATTR_CHARSET;
+	tag[0].val = "utf-8";
+	print_otag(h, TAG_META, 1, tag);
 
 	if (h->style) {
 		tag[0].key = ATTR_REL;
@@ -493,14 +486,6 @@ print_otag(struct html *h, enum htmltag 
 	for (i = 0; i < sz; i++)
 		print_attr(h, htmlattrs[p[i].key], p[i].val);
 
-	/* Add non-overridable attributes. */
-
-	if (TAG_HTML == tag && HTML_XHTML_1_0_STRICT == h->type) {
-		print_attr(h, "xmlns", "http://www.w3.org/1999/xhtml");
-		print_attr(h, "xml:lang", "en");
-		print_attr(h, "lang", "en");
-	}
-
 	/* Accommodate for XML "well-formed" singleton escaping. */
 
 	if (HTML_AUTOCLOSE & htmltags[tag].flags)
@@ -536,26 +521,8 @@ print_ctag(struct html *h, enum htmltag 
 void
 print_gen_decls(struct html *h)
 {
-	const char	*doctype;
-	const char	*dtd;
-	const char	*name;
-
-	switch (h->type) {
-	case HTML_HTML_4_01_STRICT:
-		name = "HTML";
-		doctype = "-//W3C//DTD HTML 4.01//EN";
-		dtd = "http://www.w3.org/TR/html4/strict.dtd";
-		break;
-	default:
-		puts("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-		name = "html";
-		doctype = "-//W3C//DTD XHTML 1.0 Strict//EN";
-		dtd = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";
-		break;
-	}
 
-	printf("<!DOCTYPE %s PUBLIC \"%s\" \"%s\">\n",
-	    name, doctype, dtd);
+	puts("<!DOCTYPE html>");
 }
 
 void
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2014-09-27  8:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201409270854.s8R8sYm6004271@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).