Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove occurrences of single quotes in filenames #181

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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