Skip to content

Commit

Permalink
Merge pull request #181 from MobileNativeFoundation/remove-occurrence…
Browse files Browse the repository at this point in the history
…s-of-single-quote-in-filenames

Remove occurrences of single quotes in filenames
  • Loading branch information
PatrikBillgren authored Nov 28, 2022
2 parents 1abc5b9 + 8b2517e commit 2fd6625
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ function showWarnings(target) {

function itemSelected(target, selectedItem) {
if (selectedItem.type === 'target') {
const fileName = selectedItem.identifier.replaceAll(' ', '_');
const fileName = selectedItem.identifier.replaceAll(' ', '_').replaceAll('\\\'', '_');
window.location.href = window.location.href.replace('index.html', fileName + '.html');
} else if (selectedItem.type === 'detail') {
const targetId = selectedItem.parentIdentifier.replaceAll(' ', '_');
const targetId = selectedItem.parentIdentifier.replaceAll(' ', '_').replaceAll('\\\'', '_');
if (target === 'main') {
const stepUrl = window.location.href.replace(encodeURI('{{file_name}}'), targetId + '.html');
window.location.href = stepUrl + "?step=" + selectedItem.identifier;
Expand Down
8 changes: 4 additions & 4 deletions Sources/XCLogParser/generated/HtmlReporterResources.swift
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,10 @@ function showWarnings(target) {
function itemSelected(target, selectedItem) {
if (selectedItem.type === 'target') {
const fileName = selectedItem.identifier.replaceAll(' ', '_');
const fileName = selectedItem.identifier.replaceAll(' ', '_').replaceAll('\\\'', '_');
window.location.href = window.location.href.replace('index.html', fileName + '.html');
} else if (selectedItem.type === 'detail') {
const targetId = selectedItem.parentIdentifier.replaceAll(' ', '_');
const targetId = selectedItem.parentIdentifier.replaceAll(' ', '_').replaceAll('\\\'', '_');
if (target === 'main') {
const stepUrl = window.location.href.replace(encodeURI('{{file_name}}'), targetId + '.html');
window.location.href = stepUrl + "?step=" + selectedItem.identifier;
Expand Down Expand Up @@ -1046,7 +1046,7 @@ public static let indexHTML =
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.23.0/moment-with-locales.js"></script>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/{{app_file}}"></script>
<script type="text/javascript" src="js/{{app_file}}"></script>
</body>
</html>
Expand Down Expand Up @@ -1302,7 +1302,7 @@ public static let stepHTML =
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.1.2/handlebars.min.js"></script>
<script type="text/javascript" src="js/{{data_file}}"></script>
<script type="text/javascript" src="js/{{data_file}}"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.23.0/moment-with-locales.js"></script>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
<script type="text/javascript" src="js/step.js"></script>
Expand Down
1 change: 1 addition & 0 deletions Sources/XCLogParser/reporter/HtmlReporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public struct HtmlReporter: LogReporter {
stepsWithErrors.append(contentsOf: getStepsWithErrors(target: target))
stepsWithWarnings.append(contentsOf: getStepsWithWarnings(target: target))
let targetName = target.identifier.replacingOccurrences(of: " ", with: "_")
.replacingOccurrences(of: "'", with: "_")
let name = "\(targetName).js"
let json = try encoder.encode(target.flatten())
guard let jsonString = String(data: json, encoding: .utf8) else {
Expand Down

0 comments on commit 2fd6625

Please sign in to comment.