mirror of
https://github.com/unraid/webgui.git
synced 2026-05-01 15:29:20 -05:00
dockerMan: remove HTML from descriptions
This commit is contained in:
@@ -223,6 +223,8 @@ if ($_GET['xmlTemplate']) {
|
||||
$arrConfig['Name'] = 'AppData Config Path';
|
||||
}
|
||||
}
|
||||
$arrConfig['Name'] = strip_tags($arrConfig['Name']);
|
||||
$arrConfig['Description'] = strip_tags($arrConfig['Description']);
|
||||
}
|
||||
}
|
||||
if (!empty($dockercfg['DOCKER_APP_UNRAID_PATH']) && file_exists($dockercfg['DOCKER_APP_UNRAID_PATH'])) {
|
||||
@@ -252,7 +254,8 @@ if ($_GET['xmlTemplate']) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$xml['Description'] = str_replace(['[', ']'], ['<', '>'], $xml['Overview']);
|
||||
$xml['Overview'] = str_replace(['[', ']'], ['<', '>'], $xml['Overview']);
|
||||
$xml['Description'] = $xml['Overview'] = strip_tags(str_replace("<br>","\n", $xml['Overview']));
|
||||
echo "<script>var Settings=".json_encode($xml).";</script>";
|
||||
}
|
||||
}
|
||||
@@ -1039,13 +1042,10 @@ function toggleAllocations() {
|
||||
function load_contOverview() {
|
||||
var new_overview = $("textarea[name='contOverview']").val();
|
||||
new_overview = new_overview.replaceAll("[","<").replaceAll("]",">");
|
||||
// if no html tags are present, treat the overview as Markdown
|
||||
if ( stripTags(new_overview) == new_overview ) {
|
||||
// Handle code block being created by authors indenting (manually editing the xml and spacing)
|
||||
new_overview = new_overview.replaceAll(" "," ");
|
||||
new_overview = marked(new_overview);
|
||||
} else
|
||||
new_overview = new_overview.replaceAll("\n","");
|
||||
// Handle code block being created by authors indenting (manually editing the xml and spacing)
|
||||
new_overview = new_overview.replaceAll(" "," ");
|
||||
new_overview = marked(new_overview);
|
||||
new_overview = new_overview.replaceAll("\n","<br>"); // has to be after marked
|
||||
$("#contDescription").html(new_overview);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user