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