New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

discord-markdown

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-markdown - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

6

CHANGELOG.md

@@ -0,1 +1,7 @@

# [2.3.1](https://github.com/brussell98/discord-markdown/compare/v2.3.0...v2.3.1) (2020-02-20)
### Fixes
- Code blocks without highlighting were not escaping HTML, allowing the browser to render arbitrary HTML
# [2.3.0](https://github.com/brussell98/discord-markdown/compare/v2.2.0...v2.3.0) (2020-02-04)

@@ -2,0 +8,0 @@

4

index.js

@@ -60,3 +60,3 @@ const markdown = require('simple-markdown');

if (node.lang && highlight.getLanguage(node.lang))
code = highlight.highlight(node.lang, node.content, true); // Discord seems to set ignore ignoreIllegals: true
code = highlight.highlight(node.lang, node.content, true); // Discord seems to set ignoreIllegals: true

@@ -68,3 +68,3 @@ if (code && state.cssModuleNames) // Replace classes in hljs output

return htmlTag('pre', htmlTag(
'code', code ? code.value : node.content, { class: `hljs${code ? ' ' + code.language : ''}` }, state
'code', code ? code.value : markdown.sanitizeText(node.content), { class: `hljs${code ? ' ' + code.language : ''}` }, state
), null, state);

@@ -71,0 +71,0 @@ }

{
"name": "discord-markdown",
"version": "2.3.0",
"version": "2.3.1",
"description": "A markdown parser for Discord messages",

@@ -5,0 +5,0 @@ "keywords": [

@@ -112,2 +112,6 @@ const markdown = require('../index');

.toBe('<b>test</b>');
expect(markdown.toHTML('```\n\n<b>test</b>\n```'))
.toBe('<pre><code class="hljs">&lt;b&gt;test&lt;/b&gt;</code></pre>');
expect(markdown.toHTML('```html\n\n<b>test</b>\n```'))
.toBe('<pre><code class="hljs html"><span class="hljs-tag">&lt;<span class="hljs-name">b</span>&gt;</span>test<span class="hljs-tag">&lt;/<span class="hljs-name">b</span>&gt;</span></code></pre>');
});

@@ -114,0 +118,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc