mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
add escape of stdout line
This commit is contained in:
parent
b9c071506e
commit
fbefcf59ce
@ -10,10 +10,18 @@ export default ['$log', function($log){
|
||||
// correct dom structure
|
||||
prettify: function(line, unstyled){
|
||||
|
||||
line = line
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
|
||||
// TODO: remove once Chris's fixes to the [K lines comes in
|
||||
if (line.indexOf("[K") > -1) {
|
||||
$log.error(line);
|
||||
}
|
||||
|
||||
if(!unstyled){
|
||||
// add span tags with color styling
|
||||
line = line.replace(/u001b/g, '');
|
||||
@ -32,8 +40,7 @@ export default ['$log', function($log){
|
||||
|
||||
//end span
|
||||
line = line.replace(/\[0m/g, '</span>');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// For the host event modal in the standard out tab,
|
||||
// the styling isn't necessary
|
||||
line = line.replace(/u001b/g, '');
|
||||
@ -53,6 +60,7 @@ export default ['$log', function($log){
|
||||
//end span
|
||||
line = line.replace(/\[0m/g, '');
|
||||
}
|
||||
|
||||
return line;
|
||||
},
|
||||
// adds anchor tags and tooltips to host status lines
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user