slack-markdown
Advanced tools
Comparing version 0.0.3 to 0.0.4
14
index.js
@@ -105,3 +105,2 @@ const markdown = require("simple-markdown"); | ||
newline: markdown.defaultRules.newline, | ||
escape: markdown.defaultRules.escape, | ||
autolink: Object.assign({}, markdown.defaultRules.autolink, { | ||
@@ -138,2 +137,15 @@ order: markdown.defaultRules.strong.order + 1, | ||
}), | ||
noem: { | ||
order: markdown.defaultRules.text.order, | ||
match: (source) => /^\\_/.exec(source), | ||
parse: function(capture) { | ||
return { | ||
type: "text", | ||
content: "\\_", | ||
}; | ||
}, | ||
html: function(node, output, state) { | ||
return output(node.content, state); | ||
}, | ||
}, | ||
em: Object.assign({}, markdown.defaultRules.em, { | ||
@@ -140,0 +152,0 @@ match: markdown.inlineRegex(/^\b_(\S(?:\\[\s\S]|[^\\])*?\S|\S)_(?!_)/), |
{ | ||
"name": "slack-markdown", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A markdown parser for Slack messages", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -20,1 +20,6 @@ const markdown = require("../index"); | ||
}); | ||
it("Should not lose arms", () => { | ||
expect(markdown.toHTML("¯\\_(ツ)_/¯")) | ||
.toBe("¯\\_(ツ)_/¯"); | ||
}); |
@@ -71,5 +71,5 @@ const markdown = require("../index"); | ||
it("Should escape marks", () => { | ||
it("Should not escape marks", () => { | ||
expect(markdown.toHTML("Code: \\`1 + 1` = 2`")) | ||
.toBe("Code: `1 + 1<code> = 2</code>"); | ||
.toBe("Code: \\<code>1 + 1</code> = 2`"); | ||
}); | ||
@@ -76,0 +76,0 @@ |
31540
556