blob: a48da08dc92005cd405ebf6de406686293beb123 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
const replacements = require('./replacements'),
element = require('./element'),
listen = require('./listen'),
string = require('./string');
// The smartquotes function should just delegate to the other functions
function smartquotes(context) {
if (typeof document !== 'undefined' && typeof context === 'undefined') {
listen.runOnReady(() => element(document.body));
return smartquotes;
} else if (typeof context === 'string') {
return string(context);
} else {
return element(context);
}
}
module.exports = smartquotes;
module.exports.string = string;
module.exports.element = element;
module.exports.replacements = replacements;
module.exports.listen = listen;
|