Browse Source

Remove showdown compiler

simov 8 years ago
parent
commit
903f96f262
6 changed files with 7 additions and 83 deletions
  1. 2 28
      README.md
  2. 4 4
      background/background.js
  3. 0 22
      background/showdown.js
  4. 1 25
      content/popup.js
  5. 0 2
      manifest.json
  6. 0 2
      vendor/showdown.min.js

+ 2 - 28
README.md

@@ -10,7 +10,7 @@
 - No special permissions required for file URLs
 - Full control over the allowed origins
 - Supports multiple markdown parsers
-- Full control over the [compiler options][compiler-options] ([marked][marked] or [showdown][showdown])
+- Full control over the [compiler options][compiler-options] ([marked][marked] or [remark][remark])
 - Themes support (including [GitHub theme][themes0]) ([jasonm23][themes1], [mixu][themes2], [cobalt][themes3])
 - Supports [GitHub Flavored Markdown][gfm]
 - Syntax highlighted code blocks ([prism][prism])
@@ -49,32 +49,6 @@ Option          | Default | Description
 **smartLists**  | `false` | Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.
 **smartypants** | `false` | Use "smart" typograhic punctuation for things like quotes and dashes.
 
-### Showdown
-
-Option          | Default | Description
-:---            | :---    | :---
-**disableForced4SpacesIndentedSublists** | `true` | Disables the requirement of indenting nested sublists by 4 spaces
-**encodeEmails** | `true` | Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities
-**excludeTrailingPunctuationFromURLs** | `true` | Excludes trailing punctuation from links generated with autoLinking
-**ghCodeBlocks** | `true` | Turn on/off GFM fenced code blocks support
-**ghCompatibleHeaderId** | `true` | Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)
-**ghMentions** | `true` | Enables github @mentions
-**headerLevelStart** | `false` | The header blocks level start
-**literalMidWordUnderscores** | `true` | Parse midword underscores as literal underscores
-**noHeaderId** | `false` | Turn on/off generated header id
-**omitExtraWLInCodeBlocks** | `true` | Omit the default extra whiteline added to code blocks
-**parseImgDimensions** | `false` | Turn on/off image dimension parsing
-**prefixHeaderId** | `false` | Specify a prefix to generated header ids
-**requireSpaceBeforeHeadingText** | `true` | Makes adding a space between `#` and the header text mandatory (GFM Style)
-**simpleLineBreaks** | `true` | Parses simple line breaks as <br> (GFM Style)
-**simplifiedAutoLink** | `true` | Turn on/off GFM autolink style
-**smartIndentationFix** | `false` | Tries to smartly fix indentation in es6 strings
-**smoothLivePreview** | `false` | Prevents weird effects in live previews due to incomplete input
-**strikethrough** | `true` | Turn on/off strikethrough support
-**tables** | `true` | Turn on/off tables support
-**tablesHeaderId** | `true` | Add an id to table headers
-**tasklists** | `true` | Turn on/off GFM tasklist support
-
 
 ## Content Options
 
@@ -165,7 +139,7 @@ SOFTWARE.
 
 
   [marked]: https://github.com/chjj/marked
-  [showdown]: https://github.com/showdownjs/showdown
+  [remark]: https://github.com/wooorm/remark
   [gfm]: https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown
   [compiler-options]: #compiler-options
   [themes0]: https://github.com/sindresorhus/github-markdown-css

+ 4 - 4
background/background.js

@@ -10,7 +10,6 @@ chrome.storage.sync.get((res) => {
     compiler: 'marked',
     marked: md.marked.defaults,
     remark: md.remark.defaults,
-    showdown: md.showdown.defaults,
     content: {
       toc: false,
       scroll: true
@@ -43,15 +42,17 @@ chrome.storage.sync.get((res) => {
     options.content = defaults.content
   }
   // v2.7 -> v2.8
-  if (!options.marked && !options.showdown) {
+  if (!options.marked) {
     options.compiler = 'marked'
     options.marked = md.marked.defaults
-    options.showdown = md.showdown.defaults
   }
   // v2.8 -> v2.9
   if (!options.remark) {
     options.remark = md.remark.defaults
   }
+  if (options.compiler === 'showdown') {
+    options.compiler = 'remark'
+  }
 
   chrome.storage.sync.set(options)
 
@@ -181,7 +182,6 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
       compiler: 'marked',
       marked: md.marked.defaults,
       remark: md.remark.defaults,
-      showdown: md.showdown.defaults,
       content: {toc: false, scroll: true},
       raw: false
     }, sendResponse)

+ 0 - 22
background/showdown.js

@@ -1,22 +0,0 @@
-
-md.showdown = {
-  defaults: null, // see below,
-  flavor: (name) => {
-    var options = showdown.getDefaultOptions()
-    var flavor = showdown.getFlavorOptions(name)
-    var result = {}
-    for (var key in options) {
-      result[key] = (flavor[key] !== undefined) ? flavor[key] : options[key]
-    }
-    return result
-  },
-  compile: (markdown, sendResponse) => {
-    chrome.storage.sync.get('showdown', (res) => {
-      var converter = new showdown.Converter(res.showdown)
-      var html = converter.makeHtml(markdown)
-      sendResponse({message: 'html', html})
-    })
-  }
-}
-
-md.showdown.defaults = md.showdown.flavor('github')

+ 1 - 25
content/popup.js

@@ -78,7 +78,7 @@ var ui = {
     'theme', 'compiler', 'content'
   ],
   compilers: [
-    'marked', 'remark', 'showdown'
+    'marked', 'remark'
   ],
   description: {
     compiler: {
@@ -99,30 +99,6 @@ var ui = {
         pedantic: 'Don\'t fix any of the original markdown\nbugs or poor behavior',
         breaks: 'Exposes newline characters inside paragraphs as breaks',
         sanitize: 'Toggle HTML tag rendering'
-      },
-      showdown: {
-        disableForced4SpacesIndentedSublists: "Disables the requirement of indenting nested sublists by 4 spaces",
-        encodeEmails: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",
-        excludeTrailingPunctuationFromURLs: "Excludes trailing punctuation from links generated with autoLinking",
-        ghCodeBlocks: "Turn on/off GFM fenced code blocks support",
-        ghCompatibleHeaderId: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",
-        ghMentions: "Enables github @mentions",
-        ghMentionsLink: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",
-        headerLevelStart: "The header blocks level start",
-        literalMidWordUnderscores: "Parse midword underscores as literal underscores",
-        noHeaderId: "Turn on/off generated header id",
-        omitExtraWLInCodeBlocks: "Omit the default extra whiteline added to code blocks",
-        parseImgDimensions: "Turn on/off image dimension parsing",
-        prefixHeaderId: "Specify a prefix to generated header ids",
-        requireSpaceBeforeHeadingText: "Makes adding a space between `#` and the header text mandatory (GFM Style)",
-        simpleLineBreaks: "Parses simple line breaks as <br> (GFM Style)",
-        simplifiedAutoLink: "Turn on/off GFM autolink style",
-        smartIndentationFix: "Tries to smartly fix indentation in es6 strings",
-        smoothLivePreview: "Prevents weird effects in live previews due to incomplete input",
-        strikethrough: "Turn on/off strikethrough support",
-        tables: "Turn on/off tables support",
-        tablesHeaderId: "Add an id to table headers",
-        tasklists: "Turn on/off GFM tasklist support"
       }
     },
     content: {

+ 0 - 2
manifest.json

@@ -21,10 +21,8 @@
       "/vendor/remark.min.js",
       "/vendor/remark-html.min.js",
       "/vendor/remark-slug.min.js",
-      "/vendor/showdown.min.js",
       "/background/marked.js",
       "/background/remark.js",
-      "/background/showdown.js",
       "/background/background.js"
     ],
     "persistent": false

File diff suppressed because it is too large
+ 0 - 2
vendor/showdown.min.js


Some files were not shown because too many files changed in this diff