Skip to content

Commit ff011bf

Browse files
committed
Merge PR MacDownApp#1379: Sparkle 2.x + WKWebView modernization, CVE fixes, Apple Silicon build
2 parents 3e2a2bf + e7c3de2 commit ff011bf

48 files changed

Lines changed: 2174 additions & 2502 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/tests.yml‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Tests
2+
3+
# Replaces the old .travis.yml. Travis CI's free macOS build queue for open
4+
# source projects has been effectively dead for years, and the pinned
5+
# osx_image (xcode10.1) predates this project's current
6+
# MACOSX_DEPLOYMENT_TARGET (12.0) by several major Xcode/macOS releases --
7+
# the check would never realistically complete on current infrastructure.
8+
9+
on:
10+
push:
11+
branches: [master]
12+
pull_request:
13+
branches: [master]
14+
15+
jobs:
16+
test:
17+
runs-on: macos-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
- name: Cache Bundler gems
26+
uses: actions/cache@v4
27+
with:
28+
path: vendor/bundle
29+
key: ${{ runner.os }}-bundler-${{ hashFiles('Gemfile.lock') }}
30+
restore-keys: |
31+
${{ runner.os }}-bundler-
32+
33+
- name: Cache CocoaPods
34+
uses: actions/cache@v4
35+
with:
36+
path: Pods
37+
key: ${{ runner.os }}-pods-${{ hashFiles('Podfile.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-pods-
40+
41+
- name: Install Ruby dependencies
42+
run: |
43+
bundle config set path 'vendor/bundle'
44+
bundle install
45+
46+
- name: Install CocoaPods dependencies
47+
run: bundle exec pod install
48+
49+
- name: Build peg-markdown-highlight
50+
run: make -C Dependency/peg-markdown-highlight
51+
52+
- name: Install xcpretty
53+
run: gem install xcpretty --no-document
54+
55+
- name: Run tests
56+
run: |
57+
set -o pipefail
58+
xcodebuild \
59+
-workspace MacDown.xcworkspace \
60+
-scheme MacDown \
61+
-destination 'platform=macOS' \
62+
test | xcpretty

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
.DS_Store
2828

29+
# MacDown writes a hidden sidecar HTML file next to whatever document is
30+
# open, to render the live preview (see -[MPDocument renderer:didProduceHTMLOutput:]).
31+
.macdown-preview-*.html
32+
2933
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
3034

3135
.Trashes

‎.travis.yml‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎CHANGELOG.md‎

Lines changed: 314 additions & 0 deletions
Large diffs are not rendered by default.

‎Dependency/peg-markdown-highlight/peg-markdown-highlight.xcodeproj/project.pbxproj‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXFileReference section */
@@ -50,7 +50,8 @@
5050
1F8A8367195348C500B6BF69 /* Project object */ = {
5151
isa = PBXProject;
5252
attributes = {
53-
LastUpgradeCheck = 0920;
53+
BuildIndependentTargetsInParallel = YES;
54+
LastUpgradeCheck = 2660;
5455
};
5556
buildConfigurationList = 1F8A836A195348C500B6BF69 /* Build configuration list for PBXProject "peg-markdown-highlight" */;
5657
compatibilityVersion = "Xcode 3.2";
@@ -76,19 +77,24 @@
7677
CLANG_WARN_BOOL_CONVERSION = YES;
7778
CLANG_WARN_COMMA = YES;
7879
CLANG_WARN_CONSTANT_CONVERSION = YES;
80+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
7981
CLANG_WARN_EMPTY_BODY = YES;
8082
CLANG_WARN_ENUM_CONVERSION = YES;
8183
CLANG_WARN_INFINITE_RECURSION = YES;
8284
CLANG_WARN_INT_CONVERSION = YES;
8385
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
86+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
8487
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
88+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
8589
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
8690
CLANG_WARN_STRICT_PROTOTYPES = YES;
8791
CLANG_WARN_SUSPICIOUS_MOVE = YES;
8892
CLANG_WARN_UNREACHABLE_CODE = YES;
8993
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
94+
DEAD_CODE_STRIPPING = YES;
9095
ENABLE_STRICT_OBJC_MSGSEND = YES;
9196
ENABLE_TESTABILITY = YES;
97+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
9298
GCC_NO_COMMON_BLOCKS = YES;
9399
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
94100
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -97,6 +103,7 @@
97103
GCC_WARN_UNUSED_FUNCTION = YES;
98104
GCC_WARN_UNUSED_VARIABLE = YES;
99105
ONLY_ACTIVE_ARCH = YES;
106+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
100107
};
101108
name = Debug;
102109
};
@@ -107,39 +114,47 @@
107114
CLANG_WARN_BOOL_CONVERSION = YES;
108115
CLANG_WARN_COMMA = YES;
109116
CLANG_WARN_CONSTANT_CONVERSION = YES;
117+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
110118
CLANG_WARN_EMPTY_BODY = YES;
111119
CLANG_WARN_ENUM_CONVERSION = YES;
112120
CLANG_WARN_INFINITE_RECURSION = YES;
113121
CLANG_WARN_INT_CONVERSION = YES;
114122
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
123+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
115124
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
125+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
116126
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
117127
CLANG_WARN_STRICT_PROTOTYPES = YES;
118128
CLANG_WARN_SUSPICIOUS_MOVE = YES;
119129
CLANG_WARN_UNREACHABLE_CODE = YES;
120130
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
131+
DEAD_CODE_STRIPPING = YES;
121132
ENABLE_STRICT_OBJC_MSGSEND = YES;
133+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
122134
GCC_NO_COMMON_BLOCKS = YES;
123135
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
124136
GCC_WARN_ABOUT_RETURN_TYPE = YES;
125137
GCC_WARN_UNDECLARED_SELECTOR = YES;
126138
GCC_WARN_UNINITIALIZED_AUTOS = YES;
127139
GCC_WARN_UNUSED_FUNCTION = YES;
128140
GCC_WARN_UNUSED_VARIABLE = YES;
141+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
129142
};
130143
name = Release;
131144
};
132145
1F8A837C195348C500B6BF69 /* Debug */ = {
133146
isa = XCBuildConfiguration;
134147
buildSettings = {
135-
GCC_ENABLE_FIX_AND_CONTINUE = YES;
148+
CLANG_ENABLE_OBJC_WEAK = YES;
149+
DEAD_CODE_STRIPPING = YES;
136150
};
137151
name = Debug;
138152
};
139153
1F8A837D195348C500B6BF69 /* Release */ = {
140154
isa = XCBuildConfiguration;
141155
buildSettings = {
142-
GCC_ENABLE_FIX_AND_CONTINUE = NO;
156+
CLANG_ENABLE_OBJC_WEAK = YES;
157+
DEAD_CODE_STRIPPING = YES;
143158
};
144159
name = Release;
145160
};

‎Dependency/peg-markdown-highlight/pmh_parser_head.c‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*
77
* Code to be inserted into the beginning of the parser code generated
88
* from the PEG grammar.
9+
*
10+
* Portions Copyright 2026 Roberto Bissanti.
911
*/
1012

1113
#include "pmh_parser.h"
@@ -150,7 +152,7 @@ static void parse_references(parser_data *p_data);
150152

151153

152154

153-
static char **get_element_type_names()
155+
static char **get_element_type_names(void)
154156
{
155157
static char **elem_type_names = NULL;
156158
if (elem_type_names == NULL)
@@ -460,7 +462,12 @@ static int strcpy_preformat(char *str, char **out,
460462
while (*c != '\0')
461463
{
462464
if (!IS_CONTINUATION_BYTE(*c)) {
463-
*(new_str+i) = *c, i++;
465+
// Two statements instead of a comma-operator one-liner: same
466+
// behavior (assign, then increment), but Clang flags the comma
467+
// form as a possible misuse (easy to mistake for the equality
468+
// operator at a glance).
469+
*(new_str+i) = *c;
470+
i++;
464471
} else {
465472
ADD_STRIP_POS((int)(c-str));
466473
}
@@ -967,7 +974,14 @@ static void yy_input_func(char *buf, int *result, int max_size,
967974
if (p_data->current_elem != NULL)
968975
p_data->offset = p_data->current_elem->pos;
969976
}
970-
(*result) = (EOF == yyc) ? 0 : (*(buf) = yyc, 1);
977+
// Same "assign, then use 1 as the ternary's value" idiom as above,
978+
// rewritten without the comma operator Clang flags.
979+
if (EOF == yyc) {
980+
(*result) = 0;
981+
} else {
982+
*(buf) = yyc;
983+
(*result) = 1;
984+
}
971985
return;
972986
}
973987

‎Dependency/peg-markdown-highlight/pmh_styleparser.c‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
* Licensed under the GPL2+ and MIT licenses (see LICENSE for more info).
44
*
55
* styleparser.c
6-
*
6+
*
77
* Parser for custom syntax highlighting stylesheets.
8+
*
9+
* Portions Copyright 2026 Roberto Bissanti.
810
*/
911

1012
#include <stdio.h>
@@ -198,12 +200,12 @@ static pmh_attr_argb_color *new_argb_from_hex_str(style_parser_data *p_data,
198200
return new_argb_from_hex(num, (len == 8));
199201
}
200202

201-
static pmh_attr_value *new_attr_value()
203+
static pmh_attr_value *new_attr_value(void)
202204
{
203205
return (pmh_attr_value *)malloc(sizeof(pmh_attr_value));
204206
}
205207

206-
static pmh_attr_font_styles *new_font_styles()
208+
static pmh_attr_font_styles *new_font_styles(void)
207209
{
208210
pmh_attr_font_styles *ret = (pmh_attr_font_styles *)
209211
malloc(sizeof(pmh_attr_font_styles));
@@ -213,7 +215,7 @@ static pmh_attr_font_styles *new_font_styles()
213215
return ret;
214216
}
215217

216-
static pmh_attr_font_size *new_font_size()
218+
static pmh_attr_font_size *new_font_size(void)
217219
{
218220
pmh_attr_font_size *ret = (pmh_attr_font_size *)
219221
malloc(sizeof(pmh_attr_font_size));
@@ -544,7 +546,7 @@ typedef struct block
544546
struct block *next;
545547
} block;
546548

547-
static block *new_block()
549+
static block *new_block(void)
548550
{
549551
block *ret = (block *)malloc(sizeof(block));
550552
ret->next = NULL;
@@ -870,7 +872,7 @@ static void _sty_parse(style_parser_data *p_data)
870872

871873

872874

873-
static pmh_style_collection *new_style_collection()
875+
static pmh_style_collection *new_style_collection(void)
874876
{
875877
pmh_style_collection *sc = (pmh_style_collection *)
876878
malloc(sizeof(pmh_style_collection));

‎Dependency/version/version.xcodeproj/project.pbxproj‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXFileReference section */
@@ -40,7 +40,8 @@
4040
1FCD71091A20BA3A00C028B5 /* Project object */ = {
4141
isa = PBXProject;
4242
attributes = {
43-
LastUpgradeCheck = 0920;
43+
BuildIndependentTargetsInParallel = YES;
44+
LastUpgradeCheck = 2660;
4445
ORGANIZATIONNAME = uranusjr;
4546
TargetAttributes = {
4647
1FCD710D1A20BA3A00C028B5 = {
@@ -72,19 +73,24 @@
7273
CLANG_WARN_BOOL_CONVERSION = YES;
7374
CLANG_WARN_COMMA = YES;
7475
CLANG_WARN_CONSTANT_CONVERSION = YES;
76+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
7577
CLANG_WARN_EMPTY_BODY = YES;
7678
CLANG_WARN_ENUM_CONVERSION = YES;
7779
CLANG_WARN_INFINITE_RECURSION = YES;
7880
CLANG_WARN_INT_CONVERSION = YES;
7981
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
82+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
8083
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
84+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
8185
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
8286
CLANG_WARN_STRICT_PROTOTYPES = YES;
8387
CLANG_WARN_SUSPICIOUS_MOVE = YES;
8488
CLANG_WARN_UNREACHABLE_CODE = YES;
8589
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
90+
DEAD_CODE_STRIPPING = YES;
8691
ENABLE_STRICT_OBJC_MSGSEND = YES;
8792
ENABLE_TESTABILITY = YES;
93+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
8894
GCC_NO_COMMON_BLOCKS = YES;
8995
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
9096
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -93,6 +99,7 @@
9399
GCC_WARN_UNUSED_FUNCTION = YES;
94100
GCC_WARN_UNUSED_VARIABLE = YES;
95101
ONLY_ACTIVE_ARCH = YES;
102+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
96103
};
97104
name = Debug;
98105
};
@@ -103,31 +110,39 @@
103110
CLANG_WARN_BOOL_CONVERSION = YES;
104111
CLANG_WARN_COMMA = YES;
105112
CLANG_WARN_CONSTANT_CONVERSION = YES;
113+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
106114
CLANG_WARN_EMPTY_BODY = YES;
107115
CLANG_WARN_ENUM_CONVERSION = YES;
108116
CLANG_WARN_INFINITE_RECURSION = YES;
109117
CLANG_WARN_INT_CONVERSION = YES;
110118
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
119+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
111120
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
121+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
112122
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
113123
CLANG_WARN_STRICT_PROTOTYPES = YES;
114124
CLANG_WARN_SUSPICIOUS_MOVE = YES;
115125
CLANG_WARN_UNREACHABLE_CODE = YES;
116126
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
127+
DEAD_CODE_STRIPPING = YES;
117128
ENABLE_STRICT_OBJC_MSGSEND = YES;
129+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
118130
GCC_NO_COMMON_BLOCKS = YES;
119131
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
120132
GCC_WARN_ABOUT_RETURN_TYPE = YES;
121133
GCC_WARN_UNDECLARED_SELECTOR = YES;
122134
GCC_WARN_UNINITIALIZED_AUTOS = YES;
123135
GCC_WARN_UNUSED_FUNCTION = YES;
124136
GCC_WARN_UNUSED_VARIABLE = YES;
137+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
125138
};
126139
name = Release;
127140
};
128141
1FCD71111A20BA3A00C028B5 /* Debug */ = {
129142
isa = XCBuildConfiguration;
130143
buildSettings = {
144+
CLANG_ENABLE_OBJC_WEAK = YES;
145+
DEAD_CODE_STRIPPING = YES;
131146
DEBUGGING_SYMBOLS = YES;
132147
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
133148
GCC_OPTIMIZATION_LEVEL = 0;
@@ -140,6 +155,8 @@
140155
1FCD71121A20BA3A00C028B5 /* Release */ = {
141156
isa = XCBuildConfiguration;
142157
buildSettings = {
158+
CLANG_ENABLE_OBJC_WEAK = YES;
159+
DEAD_CODE_STRIPPING = YES;
143160
OTHER_CFLAGS = "";
144161
OTHER_LDFLAGS = "";
145162
PRODUCT_NAME = "$(TARGET_NAME)";

0 commit comments

Comments
 (0)