mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
Improve extracting signed markdown content (#2828)
This strips the beginning sparkle sign warning comment (if present) in the release notes downloader driver rather than the user driver. The comment is also stripped (if present) in generate_appcast when inserting embedded release notes. Also improve markdown compatibility with sparkle-cli and alternative user driver in Sparkle Test App.
This commit is contained in:
17 files changed
+188
-99
No files matched your search
@@ -82,7 +82,7 @@
|
||||
NSData *descriptionData = [appcastItem.itemDescription dataUsingEncoding:NSUTF8StringEncoding];
|
||||
if (descriptionData != nil) {
|
||||
NSString *itemDescriptionFormat = appcastItem.itemDescriptionFormat;
|
||||
if (itemDescriptionFormat != nil && [itemDescriptionFormat isEqualToString:@"plain-text"]) {
|
||||
if (itemDescriptionFormat != nil && ([itemDescriptionFormat isEqualToString:@"plain-text"] || [itemDescriptionFormat isEqualToString:@"markdown"])) {
|
||||
[self displayPlainTextReleaseNotes:descriptionData encoding:NSUTF8StringEncoding];
|
||||
} else {
|
||||
[self displayHTMLReleaseNotes:descriptionData];
|
||||
@@ -124,7 +124,9 @@
|
||||
- (void)showUpdateReleaseNotesWithDownloadData:(SPUDownloadData *)downloadData
|
||||
{
|
||||
if (_verbose) {
|
||||
if (downloadData.MIMEType != nil && [downloadData.MIMEType isEqualToString:@"text/plain"]) {
|
||||
NSString *MIMEType = downloadData.MIMEType;
|
||||
NSString *fileExtension = downloadData.URL.pathExtension;
|
||||
if ([MIMEType isEqualToString:@"text/plain"] || [MIMEType isEqualToString:@"text/markdown"] || [MIMEType isEqualToString:@"text/x-markdown"] || [fileExtension caseInsensitiveCompare:@"txt"] == NSOrderedSame || [fileExtension caseInsensitiveCompare:@"md"] == NSOrderedSame || [fileExtension caseInsensitiveCompare:@"markdown"] == NSOrderedSame) {
|
||||
NSStringEncoding encoding;
|
||||
if (downloadData.textEncodingName == nil) {
|
||||
encoding = NSUTF8StringEncoding;
|
||||
|
||||
Reference in new issue
Block a user