mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
feat: Escape ansi code
This commit is contained in:
parent
e47b30a88f
commit
89ad7edcd5
2 changed files with 5 additions and 1 deletions
|
|
@ -27,6 +27,7 @@
|
|||
"dependencies": {
|
||||
"angular-ui-grid": "^4.0.4",
|
||||
"angular-viewport-watch": "github:shahata/angular-viewport-watch",
|
||||
"ansi_up": "^2.0.2",
|
||||
"github-markdown-css": "2.6.0",
|
||||
"grunt-angular-templates": "^0.5.7",
|
||||
"grunt-dom-munger": "^3.4.0",
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ import {
|
|||
} from '../../../spell'
|
||||
import { ParagraphStatus, } from '../paragraph.status'
|
||||
|
||||
const AnsiUp = require('ansi_up')
|
||||
const AnsiUpConverter = new AnsiUp.default // eslint-disable-line new-parens,new-cap
|
||||
const TableGridFilterTemplate = require('../../../visualization/builtins/visualization-table-grid-filter.html')
|
||||
|
||||
angular.module('zeppelinWebApp').controller('ResultCtrl', ResultCtrl)
|
||||
|
|
@ -470,7 +472,8 @@ function ResultCtrl ($scope, $rootScope, $route, $window, $routeParams, $locatio
|
|||
removeChildrenDOM(targetElemId)
|
||||
|
||||
if (generated) {
|
||||
const divDOM = angular.element('<div></div>').text(generated)
|
||||
const escaped = AnsiUpConverter.ansi_to_html(generated)
|
||||
const divDOM = angular.element('<div></div>').innerHTML = escaped
|
||||
elem.append(divDOM)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue