Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into more-tests

* 'gh-pages' of https://github.com/chunpu/markdown2confluence:
  remove the useless comma
  fix the bug that code lang may be undefiend and set default lang to 'none'
  Add html and xml support and add case insensitive
  chore(readme): Fix badge display
  修复 link text 问题
  • Loading branch information
Whoaa512 committed Dec 1, 2017
2 parents d79a944 + ee15eef commit 6a90d1f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 2 additions & 3 deletions browser/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
}
, link: function(href, title, text) {
var arr = [href]
if (title) {
arr.unshift(title)
if (text) {
arr.unshift(text)
}
return '[' + arr.join('|') + ']'
}
Expand All @@ -141,7 +141,6 @@
return body + '\n'
}
, image: function(href, title, text) {
console.log(77777, href)
return '!' + href + '!'
}
, table: function(header, body) {
Expand Down
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ var rawRenderer = marked.Renderer

var langArr = 'actionscript3 bash csharp coldfusion cpp css delphi diff erlang groovy java javafx javascript perl php none powershell python ruby scala sql vb html/xml'.split(/\s+/)
var langMap = {
shell: 'bash'
shell: 'bash',
html: 'html',
xml: 'xml'
}
for (var i = 0, x; x = langArr[i++];) {
langMap[x] = x
Expand Down Expand Up @@ -105,7 +107,10 @@ _.extend(Renderer.prototype, rawRenderer.prototype, {
}
, code: function(code, lang) {
// {code:language=java|borderStyle=solid|theme=RDark|linenumbers=true|collapse=true}
lang = langMap[lang] || ''
if(lang) {
lang = lang.toLowerCase()
}
lang = langMap[lang] || 'none'
var param = {
language: lang,
borderStyle: 'solid',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "markdown2confluence",
"version": "1.2.0",
"version": "1.3.0",
"description": "convert markdown to confluence markup",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ markdown2confluence
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][downloads-url]
[![Dependency Status][david-image]][david-url]

[npm-image]: https://img.shields.io/npm/v/markdown2confluence.svg?style=flat-square
[npm-url]: https://npmjs.org/package/markdown2confluence
[downloads-image]: http://img.shields.io/npm/dm/markdown2confluence.svg?style=flat-square
Expand Down

0 comments on commit 6a90d1f

Please sign in to comment.