Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update highlight.js to latest version #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"dependencies": {
"handlebars-utils": "^1.0.2",
"highlight.js": "^9.12.0",
"highlight.js": "^10.4.1",
"remarkable": "^1.7.1"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('helper-markdown', function() {

it('should highlight code blocks', function() {
var html = markdown('```js\nvar foo = "bar";\n```\n', {});
assert.equal(html, '<pre><code class="language-js"><span class="hljs-keyword">var</span> foo = <span class="hljs-string">"bar"</span>;\n</code></pre>\n');
assert.equal(html, '<pre><code class="language-js"><span class="hljs-keyword">var</span> foo = <span class="hljs-string">&quot;bar&quot;</span>;\n</code></pre>\n');
});

it('should pass options to remarkable', function() {
Expand All @@ -27,7 +27,7 @@ describe('helper-markdown', function() {

it('should pass options to highlight.js:', function() {
var html = markdown('```js\nvar foo = "bar";\n```\n', {langPrefix: 'language-'});
assert.equal(html, '<pre><code class="language-js"><span class="hljs-keyword">var</span> foo = <span class="hljs-string">"bar"</span>;\n</code></pre>\n');
assert.equal(html, '<pre><code class="language-js"><span class="hljs-keyword">var</span> foo = <span class="hljs-string">&quot;bar&quot;</span>;\n</code></pre>\n');
});
});

Expand All @@ -54,11 +54,11 @@ describe('helper-markdown', function() {

// `langPrefix = language-`
var a = handlebars.compile('{{#markdown}}```js\nvar foo = "bar";\n```\n{{/markdown}}')();
assert.equal(a, '<pre><code class="language-js"><span class="hljs-keyword">var</span> foo = <span class="hljs-string">"bar"</span>;\n</code></pre>\n');
assert.equal(a, '<pre><code class="language-js"><span class="hljs-keyword">var</span> foo = <span class="hljs-string">&quot;bar&quot;</span>;\n</code></pre>\n');

// `langPrefix = language-`
var b = handlebars.compile('{{#markdown langPrefix="language-"}}```js\nvar foo = "bar";\n```\n{{/markdown}}')();
assert.equal(b, '<pre><code class="language-js"><span class="hljs-keyword">var</span> foo = <span class="hljs-string">"bar"</span>;\n</code></pre>\n');
assert.equal(b, '<pre><code class="language-js"><span class="hljs-keyword">var</span> foo = <span class="hljs-string">&quot;bar&quot;</span>;\n</code></pre>\n');
});
});

Expand Down