Skip to content

Commit 2f2acd0

Browse files
committed
Add only parse strikethrough double tilde option
1 parent 1bff2d1 commit 2f2acd0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/Markdown/Parser/CommonMarkConverter.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,9 @@ struct MarkupParser {
620620
if !options.contains(.disableSourcePosOpts) {
621621
cmarkOptions |= CMARK_OPT_SOURCEPOS
622622
}
623+
if options.contains(.onlyParseStrikethroughDoubleTilde) {
624+
cmarkOptions |= CMARK_OPT_STRIKETHROUGH_DOUBLE_TILDE
625+
}
623626

624627
let parser = cmark_parser_new(cmarkOptions)
625628

Sources/Markdown/Parser/ParseOptions.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@ public struct ParseOptions: OptionSet {
3030

3131
/// Disable including a `data-sourcepos` attribute on all block elements during parsing.
3232
public static let disableSourcePosOpts = ParseOptions(rawValue: 1 << 4)
33+
34+
/// Only parse strikethroughs if surrounded by exactly 2 tildes.
35+
public static let onlyParseStrikethroughDoubleTilde = ParseOptions(rawValue: 1 << 5)
3336
}
3437

0 commit comments

Comments
 (0)