Last active
August 29, 2015 14:20
-
-
Save pdeschen/871c7a20c6a29a08a6b3 to your computer and use it in GitHub Desktop.
map extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/164979/uk-postcode-regex-comprehensive | |
(function(){ | |
var maps = function(converter) { | |
return [ { | |
type: 'lang', | |
filter: function(text) { | |
return text.replace(/\[map (GIR 0AA|[A-PR-UWYZ]([A-HK-Y]([0-9][A-Z]?|[1-9][0-9])|[1-9]([0-9]|[A-HJKPSTUW])?) ?[0-9][ABD-HJLNP-UW-Z]{2})\]/ig, 'map'); | |
} | |
}]; | |
}; | |
// Client-side export | |
if (typeof window !== 'undefined' && window.Showdown && window.Showdown.extensions) { window.Showdown.extensions.maps = maps; } | |
// Server-side export | |
if (typeof module !== 'undefined') module.exports = maps; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment