Convert ansi from exclaim to HTML.

This commit is contained in:
Oliver Blanthorn 2018-04-26 17:46:57 +01:00
parent 5959d2d28e
commit 6ef4b2bbae
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
3 changed files with 14 additions and 4 deletions

11
package-lock.json generated
View file

@ -305,6 +305,14 @@
"color-convert": "1.9.0"
}
},
"ansi-to-html": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/ansi-to-html/-/ansi-to-html-0.6.4.tgz",
"integrity": "sha512-XuUGfj3zOAg3/NCU7Oyf9PaCyFuDVj8dzMqezMycPxo5U52atXt+R4L/zW7ETNA2GTjyj/KGBVEFI8sgPWUu2w==",
"requires": {
"entities": "1.1.1"
}
},
"any-promise": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
@ -2354,8 +2362,7 @@
"entities": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=",
"dev": true
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA="
},
"errno": {
"version": "0.1.4",

View file

@ -4,6 +4,7 @@
"description": "Vimperator/Pentadactyl successor",
"dependencies": {
"@types/nearley": "^2.11.0",
"ansi-to-html": "^0.6.4",
"fuse.js": "^3.2.0",
"mark.js": "^8.11.1",
"nearley": "^2.11.0",

View file

@ -97,6 +97,7 @@ import * as Logging from "./logging"
const logger = new Logging.Logger("excmds")
import Mark from "mark.js"
import * as semverCompare from "semver-compare"
import * as ansiConvert from "ansi-to-html"
//#content_helper
// {
@ -211,7 +212,8 @@ export async function nativegate(version = "0", interactive = true): Promise<Boo
//#background
export async function exclaim(...str: string[]) {
fillcmdline((await Native.run(str.join(" "))).content)
const convert = new ansiConvert()
fillcmdline(convert.toHtml((await Native.run(str.join(" "))).content))
} // should consider how to give option to fillcmdline or not. We need flags.
//#background