Skip to content

Commit

Permalink
Merge branch 'gh-pages' into more-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Whoaa512 authored Dec 1, 2017
2 parents d79a944 + ee15eef commit c66d396
Show file tree
Hide file tree
Showing 4 changed files with 12 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
10 changes: 8 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 @@ -57,6 +59,7 @@ _.extend(Renderer.prototype, rawRenderer.prototype, {
}
, link: function(href, title, text) {
var arr = [href]

if (title) {
arr.push(title)
}
Expand Down Expand Up @@ -105,7 +108,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 c66d396

Please sign in to comment.