Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

HTML5 semantics #1

Merged
merged 2 commits into from

1 participant

@tantek
Owner

No description provided.

@tantek tantek merged commit 98b8301 into tantek:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 14, 2011
  1. add support for time element.

    authored
  2. time element support

    authored
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 3 deletions.
  1. +4 −3 README
  2. +4 −0 SemanticHTML.class.php
View
7 README
@@ -1,16 +1,17 @@
MediaWiki Extension — SemanticHTML
-SemanticHTML is a simple MediaWiki extension to add support for the HTML4
-phrase elements to MediaWiki. By default, MediaWiki strips out these
+SemanticHTML is a simple MediaWiki extension to add support for HTML4 phrase elements
+plus the HTML5 time element to MediaWiki. By default, MediaWiki strips out these
descriptive elements.
-This extension restore support for:
+This extension adds support for:
* abbr
* acronym
* dfn
* kbd
* samp
+ * time
* var
Originally written for microformats.org/wiki, by Ben Ward
View
4 SemanticHTML.class.php
@@ -22,6 +22,7 @@ class SemanticHTMLParser {
'parseDfn' => 'dfn',
'parseKbd' => 'kbd',
'parseSamp' => 'samp',
+ 'parseTime' => 'time',
'parseVar' => 'var',
);
@@ -41,6 +42,9 @@ public static function parseKbd($text, $attributes, $parser) {
public static function parseSamp($text, $attributes, $parser) {
return SemanticHTMLParser::parseElement('samp', $text, $attributes, $parser);
}
+ public static function parseTime($text, $attributes, $parser) {
+ return SemanticHTMLParser::parseElement('time', $text, $attributes, $parser);
+ }
public static function parseVar($text, $attributes, $parser) {
return SemanticHTMLParser::parseElement('var', $text, $attributes, $parser);
}
Something went wrong with that request. Please try again.