Przeglądaj źródła

bug fixes:

+ fix bug with forEach extensions within client-side handling (browser)
+ update README to specify extension as array for client-side usage (same as server)
Pascal Deschenes 12 lat temu
rodzic
commit
caa98a8dde
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      README.md
  2. 1 1
      src/showdown.js

+ 1 - 1
README.md

@@ -116,7 +116,7 @@ Showdown allows additional functionality to be loaded via extensions.
 <script src="src/showdown.js" />
 <script src="src/extensions/twitter.js" />
 
-var converter = new Showdown().converter({ extensions: 'twitter' });
+var converter = new Showdown().converter({ extensions: ['twitter'] });
 ```
 
 ### Server-side Extension Usage

+ 1 - 1
src/showdown.js

@@ -143,7 +143,7 @@ if (typeof module !== 'undefind' && typeof exports !== 'undefined' && typeof req
 if (converter_options && converter_options.extensions) {
 
 	// Iterate over each plugin
-	converter_options.extensions.forEach(function(plugin){
+	forEach(converter_options.extensions, function(plugin){
 
 		// Assume it's a bundled plugin if a string is given
 		if (typeof plugin === 'string') {