Comparing version 1.8.1 to 1.9.0
@@ -94,2 +94,5 @@ var Mehdown; | ||
// Archive.org games | ||
text = text.replace(/\[archiveorg (\w+).*\]/g, Mehdown.archiveOrg('$1')); | ||
// Images | ||
@@ -142,2 +145,6 @@ var imgRegExp = /<a href="(https?:\/\/[-\w%\/\.]+\.(?:jpg|jpeg|gif|png)(?:\?[-\+=&;%@\.\w]+)?)">\1<\/a>/gi; | ||
Mehdown.archiveOrg = function(entry) { | ||
return '<iframe allowfullscreen class="archiveorg" frameborder="0" mozallowfullscreen="true" src="//archive.org/embed/' + entry + '" webkitallowfullscreen="true"></iframe>'; | ||
}; | ||
Mehdown.header = function(suffix) { | ||
@@ -144,0 +151,0 @@ function toSlug(value) { |
@@ -13,3 +13,3 @@ { | ||
}, | ||
"version": "1.8.1" | ||
"version": "1.9.0" | ||
} |
@@ -16,3 +16,4 @@ mehdown | ||
- Support for opening external links in a new browser tab/window | ||
- Support for the The Internet Archive Software Collection in their embed format: [archiveorg PacMan1981Atari width=560 height=384 frameborder=0 webkitallowfullscreen=true mozallowfullscreen=true] | ||
[![Build Status](https://travis-ci.org/mediocre/mehdown.png?branch=master)](https://travis-ci.org/mediocre/mehdown) |
@@ -254,1 +254,8 @@ var assert = require('assert'); | ||
}); | ||
describe('archive.org embeds', function() { | ||
it('[archiveorg arcade_3stooges width=560 height=384 frameborder=0 webkitallowfullscreen=true mozallowfullscreen=true]', function() { | ||
var text = mehdown.parse('<p>[archiveorg arcade_3stooges width=560 height=384 frameborder=0 webkitallowfullscreen=true mozallowfullscreen=true]</p>'); | ||
assert.equal(text, '<p><iframe allowfullscreen class="archiveorg" frameborder="0" mozallowfullscreen="true" src="//archive.org/embed/arcade_3stooges" webkitallowfullscreen="true"></iframe></p>'); | ||
}); | ||
}); |
37133
376
19