Comparing version 0.8.0 to 0.9.0
11
index.js
@@ -1,2 +0,4 @@ | ||
var hljs = require('highlight.js'); | ||
var hljs = require('highlight.js'); | ||
var entities = require('html-entities'); | ||
var colorize; | ||
@@ -71,3 +73,3 @@ | ||
return { | ||
ansi: out.ansi, | ||
ansi: entities.decode(out.ansi, {level: 'html5', scope: 'strict'}), | ||
language: out.language, | ||
@@ -156,6 +158,3 @@ html: out.value, | ||
.replace(/<span class="([^"]*)">/g, '') | ||
.replace(/<\/span>/g, '') | ||
.replace(/</g, '<') | ||
.replace(/>/g, '>') | ||
.replace(/&/g, '&'); | ||
.replace(/<\/span>/g, ''); | ||
} | ||
@@ -162,0 +161,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"repository": { | ||
@@ -20,3 +20,4 @@ "type": "git", | ||
"dependencies": { | ||
"highlight.js": "^10.4.1", | ||
"highlight.js": "^10.5.0", | ||
"html-entities": "^2.0.6", | ||
"minimist": "^1.2.5" | ||
@@ -23,0 +24,0 @@ }, |
# hicat :cat: | ||
![image](https://user-images.githubusercontent.com/74385/102151429-f6ccdd80-3ec6-11eb-84a4-68358ac2bc3b.png) | ||
![image](https://raw.githubusercontent.com/rstacruz/hicat/gh-pages/hicat.gif) | ||
@@ -20,5 +20,5 @@ `cat` with syntax highlighting. The language is auto-detected through the file | ||
````sh | ||
```sh | ||
curl http://example.com | hicat -l xml | ||
`` | ||
``` | ||
@@ -31,3 +31,3 @@ [![Status](https://travis-ci.org/rstacruz/hicat.svg?branch=master)](https://travis-ci.org/rstacruz/hicat) | ||
npm install -g hicat | ||
```` | ||
``` | ||
@@ -34,0 +34,0 @@ [![npm version](https://badge.fury.io/js/hicat.svg)](https://npmjs.org/package/hicat "View this project on npm") |
@@ -75,8 +75,2 @@ require('./setup'); | ||
it('produces ansi codes', function () { | ||
var inputEscaped = 'var x = 2345 + "hi"; /*yo*/ window.document.x = function($){};'; | ||
var code = str.replace(/\033[^m]+m/g, ''); | ||
expect(code).eql(inputEscaped); | ||
}); | ||
it('highlights numbers', function () { | ||
@@ -83,0 +77,0 @@ var fragment = hicat.colorize('2345', hicat.color('number', 'javascript')); |
27886
3
708
+ Addedhtml-entities@^2.0.6
+ Addedhtml-entities@2.5.2(transitive)
Updatedhighlight.js@^10.5.0