Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit a298e30

Browse files
committed
Suppress escaping of "/" characters in displayed property values
Also bumped version to 0.6 since 0.5 was tagged.
1 parent 211d7fc commit a298e30

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Couchbase Lite Viewer.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@
371371
CLANG_WARN_UNREACHABLE_CODE = YES;
372372
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
373373
COPY_PHASE_STRIP = NO;
374-
CURRENT_PROJECT_VERSION = 0.5;
374+
CURRENT_PROJECT_VERSION = 0.6;
375375
ENABLE_STRICT_OBJC_MSGSEND = YES;
376376
ENABLE_TESTABILITY = YES;
377377
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -426,7 +426,7 @@
426426
CLANG_WARN_UNREACHABLE_CODE = YES;
427427
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
428428
COPY_PHASE_STRIP = YES;
429-
CURRENT_PROJECT_VERSION = 0.5;
429+
CURRENT_PROJECT_VERSION = 0.6;
430430
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
431431
ENABLE_STRICT_OBJC_MSGSEND = YES;
432432
GCC_C_LANGUAGE_STANDARD = gnu99;

Source/JSONFormatter.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ + (NSString*) stringForObjectValue: (id)obj {
2222

2323

2424
- (NSString *)stringForObjectValue: (id)obj {
25+
// For display purposes, remove the escaping before slashes that NSJSONSerialization puts in.
26+
// I'm not 100% sure this is always safe, so I'm not doing it for the string being edited.
27+
NSString* json = [[self class] stringForObjectValue: obj];
28+
return [json stringByReplacingOccurrencesOfString: @"\\/" withString: @"/"];
29+
}
30+
31+
- (nullable NSString *)editingStringForObjectValue: (id)obj {
2532
return [[self class] stringForObjectValue: obj];
2633
}
2734

0 commit comments

Comments
 (0)