mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
make compatible with browserify
added ability to disable extensions search on node so that the call to `fs.readdirSync` can be disabled when showdowns is being used with browserify (because that call cannot be handled by browserify)
This commit is contained in:
parent
b3cc121d43
commit
3af3760263
|
@ -95,6 +95,9 @@ var stdExtName = function(s) {
|
||||||
//
|
//
|
||||||
Showdown.converter = function(converter_options) {
|
Showdown.converter = function(converter_options) {
|
||||||
|
|
||||||
|
// set converter_options to a plain object if its undefined
|
||||||
|
converter_options = converter_options === undefined ? {} : converter_options
|
||||||
|
|
||||||
//
|
//
|
||||||
// Globals:
|
// Globals:
|
||||||
//
|
//
|
||||||
|
@ -117,7 +120,7 @@ var g_output_modifiers = [];
|
||||||
// Automatic Extension Loading (node only):
|
// Automatic Extension Loading (node only):
|
||||||
//
|
//
|
||||||
|
|
||||||
if (typeof module !== 'undefined' && typeof exports !== 'undefined' && typeof require !== 'undefind') {
|
if (converter_options.node !== false && typeof module !== 'undefined' && typeof exports !== 'undefined' && typeof require !== 'undefind') {
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
if (fs) {
|
if (fs) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user