smartquotes
Advanced tools
Comparing version 2.0.2 to 2.0.3
{ | ||
"name": "smartquotes", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"author": "Kelly Martin", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -13,3 +13,3 @@ (function (root, factory) { | ||
function smartquotes(context) { | ||
if (typeof context === 'undefined') { | ||
if (typeof document !== 'undefined' && typeof context === 'undefined') { | ||
var run = function() { smartquotes.element(document.body); }; | ||
@@ -32,3 +32,3 @@ // if called without arguments, run on the entire body after the document has loaded | ||
return smartquotes.string(context); | ||
} else if (context instanceof HTMLElement) { | ||
} else { | ||
return smartquotes.element(context); | ||
@@ -55,3 +55,3 @@ } | ||
smartquotes.element = function(root) { | ||
var TEXT_NODE = Element.TEXT_NODE || 3; | ||
var TEXT_NODE = typeof Element !== 'undefined' && Element.TEXT_NODE || 3; | ||
@@ -61,3 +61,3 @@ handleElement(root); | ||
function handleElement(el) { | ||
if (['CODE', 'PRE', 'SCRIPT', 'STYLE'].indexOf(el.nodeName) !== -1) { | ||
if (['CODE', 'PRE', 'SCRIPT', 'STYLE'].indexOf(el.nodeName.toUpperCase()) !== -1) { | ||
return; | ||
@@ -64,0 +64,0 @@ } |
35586