From afe798626a7606ca2f2c165467855a2a69b88598 Mon Sep 17 00:00:00 2001 From: Riley Lynch Date: Wed, 9 Jan 2013 13:06:57 -0500 Subject: [PATCH 1/3] Add filter attribute name to extension example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1985418..6df944d0 100644 --- a/README.md +++ b/README.md @@ -256,7 +256,7 @@ Alternately, if you'd just like to do everything yourself, you can specify a fil var demo = function(converter) { return [ // Replace escaped @ symbols - { type: 'lang', function(text) { + { type: 'lang', filter: function(text) { return text.replace(/\\@/g, '@'); }} ]; From b02eff4bb7ac108f4e6ea74be04a6964cb00943c Mon Sep 17 00:00:00 2001 From: Riley Lynch Date: Wed, 9 Jan 2013 13:14:35 -0500 Subject: [PATCH 2/3] Clarify extension API Added detail about use of `type` attribute --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6df944d0..e11615c6 100644 --- a/README.md +++ b/README.md @@ -224,12 +224,12 @@ New test cases can easily be added. Create a markdown file (ending in `.md`) wh ## Creating Markdown Extensions -A showdown extension is simply a function which returns an array of extensions. Each single extension can be one of two types: +A showdown extension is simply a function which returns an array of language extensions and/or output modifiers: - * Language Extension -- Language extensions are ones that that add new markdown syntax to showdown. For example, say you wanted `^^youtube http://www.youtube.com/watch?v=oHg5SJYRHA0` to automatically render as an embedded YouTube video, that would be a language extension. - * Output Modifiers -- After showdown has run, and generated HTML, an output modifier would change that HTML. For example, say you wanted to change `
` to be `
`, that would be an output modifier. + * Language Extension -- Language extensions are specified with the `lang` type, and add new markdown syntax to showdown. For example, say you wanted `^^youtube http://www.youtube.com/watch?v=oHg5SJYRHA0` to automatically render as an embedded YouTube video, that would be a language extension. + * Output Modifiers -- Output Modifiers are specified with the `output` type. After showdown has generated HTML, an output modifier can make changes to the generated HTML. For example, if you wanted to change `
` to be `
`, you could implement an output modifier. -Each extension can provide two combinations of interfaces for showdown. +Each showdown extension can provide language extensions and/or output modifiers. ### Regex/Replace From 9c33c6aa87a682cd6917e1e96898e15cf4122db3 Mon Sep 17 00:00:00 2001 From: Daniel Quinn Date: Thu, 28 Mar 2013 14:18:16 +0100 Subject: [PATCH 3/3] extensions should be a list, not a string. This confused me a for a bit until I realised what was wrong. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1985418..f53c460c 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Showdown allows additional functionality to be loaded via extensions.