Repository: SwiftDocOrg/CommonMark Branch: main Commit: 6fc9d04ff536 Files: 79 Total size: 414.3 KB Directory structure: gitextract_min7gahu/ ├── .github/ │ └── workflows/ │ ├── ci.yml │ └── documentation.yml ├── .gitignore ├── Changelog.md ├── LICENSE.md ├── Makefile ├── Package.resolved ├── Package.swift ├── README.md ├── Resources/ │ ├── CommonMarkSpecTests.swift.gyb │ └── camelcase.awk ├── Sources/ │ └── CommonMark/ │ ├── Nodes/ │ │ ├── Block/ │ │ │ ├── BlockQuote.swift │ │ │ ├── CodeBlock.swift │ │ │ ├── HTMLBlock.swift │ │ │ ├── Heading.swift │ │ │ ├── List.swift │ │ │ ├── Paragraph.swift │ │ │ └── ThematicBreak.swift │ │ ├── Document.swift │ │ ├── Inline/ │ │ │ ├── Code.swift │ │ │ ├── Emphasis.swift │ │ │ ├── HardLineBreak.swift │ │ │ ├── Image.swift │ │ │ ├── Link.swift │ │ │ ├── RawHTML.swift │ │ │ ├── SoftLineBreak.swift │ │ │ ├── Strong.swift │ │ │ └── Text.swift │ │ └── Node.swift │ ├── Result Builders/ │ │ ├── ContainerOfBlocksBuilder.swift │ │ ├── ContainerOfInlineElementsBuilder.swift │ │ └── ListBuilder.swift │ ├── Supporting Types/ │ │ ├── Block.swift │ │ ├── Children.swift │ │ ├── Fragment.swift │ │ ├── Inline.swift │ │ ├── LineBreak.swift │ │ ├── Linked.swift │ │ ├── Literal.swift │ │ ├── Section.swift │ │ ├── Visitable.swift │ │ └── Visitor.swift │ └── Version.swift └── Tests/ ├── CommonMarkSpecTests/ │ ├── AtxHeadingsTests.swift │ ├── AutolinksTests.swift │ ├── BackslashEscapesTests.swift │ ├── BlankLinesTests.swift │ ├── BlockQuotesTests.swift │ ├── CodeSpansTests.swift │ ├── EmphasisAndStrongEmphasisTests.swift │ ├── EntityAndNumericCharacterReferencesTests.swift │ ├── FencedCodeBlocksTests.swift │ ├── HardLineBreaksTests.swift │ ├── HtmlBlocksTests.swift │ ├── ImagesTests.swift │ ├── IndentedCodeBlocksTests.swift │ ├── InlinesTests.swift │ ├── LinkReferenceDefinitionsTests.swift │ ├── LinksTests.swift │ ├── ListItemsTests.swift │ ├── ListsTests.swift │ ├── ParagraphsTests.swift │ ├── PrecedenceTests.swift │ ├── RawHtmlTests.swift │ ├── SetextHeadingsTests.swift │ ├── SoftLineBreaksTests.swift │ ├── TabsTests.swift │ ├── TextualContentTests.swift │ └── ThematicBreaksTests.swift ├── CommonMarkTests/ │ ├── CommonMarkBuilderTests.swift │ ├── CommonMarkTests.swift │ ├── ContainerManipulationTests.swift │ ├── DocumentTests.swift │ ├── Fixtures.swift │ ├── NodeTests.swift │ ├── ProtocolTests.swift │ ├── StatisticsVisitor.swift │ └── VisitorTests.swift └── LinuxMain.swift ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/ci.yml ================================================ name: CI on: push: branches: [main] pull_request: branches: [main] jobs: macos: runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v1 - name: Build and Test run: swift test linux: runs-on: ubuntu-latest strategy: matrix: swift: - "5.3" - "5.4" container: image: swift:${{ matrix.swift }} steps: - name: Checkout uses: actions/checkout@v1 - name: Build and Test run: swift test --enable-test-discovery windows: runs-on: windows-latest steps: - uses: actions/checkout@v2 - uses: seanmiddleditch/gha-setup-vsdevenv@master - name: Install swift-5.4 run: | Install-Binary -Url "https://swift.org/builds/swift-5.4-release/windows10/swift-5.4-RELEASE/swift-5.4-RELEASE-windows10.exe" -Name "installer.exe" -ArgumentList ("-q") - name: Set Environment Variables run: | echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Adjust Paths run: | echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Install Supporting Files run: | Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap" Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap" Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes" Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap" - name: Build and Test run: swift test --enable-test-discovery ================================================ FILE: .github/workflows/documentation.yml ================================================ name: Documentation on: push: branches: - main paths: - .github/workflows/documentation.yml - Sources/**.swift jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v1 - name: Generate Documentation uses: SwiftDocOrg/swift-doc@master with: inputs: "Sources" output: "Documentation" - name: Upload Documentation to Wiki uses: SwiftDocOrg/github-wiki-publish-action@master with: path: "Documentation" env: GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }} ================================================ FILE: .gitignore ================================================ .DS_Store /.build /Packages /*.xcodeproj xcuserdata/ .swiftpm Resources/spec* ================================================ FILE: Changelog.md ================================================ # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [0.5.1] - 2021-05-04 ### Added - Added `replace(child:with:)` methods for container nodes. #26 by @mattt. ### Fixed - Fixed documentation for `List`. #29 by @mattt. ### Changed - Changed implementation of `Hashable` conformance for `Node`. Previously the hash value of a node was computed from its content. Now it's computed from the opaque cmark pointer. #30 by @Lukas-Stuehrk. ## [0.5.0] - 2021-01-14 ### Added - Added support for the visitor pattern, by adding `protocol Visitor`/`protocol Visitable` & `enum VisitorContinueKind`. #13 by @regexident. ### Fixed - Fixed document parsing options. #21 by @regexident. - Fixed memory leaks. #22 by @regexident. ## [0.4.0] - 2020-05-01 ### Added - Added a changelog. #17 by @mattt. ### Changed - Changed `render` method, as well as nested `RenderingFormat` and `RenderingOptions` types, from `Document` to `Node`. #18 by @mattt. ### Fixed - Fixed abbreviation for "Universal Declaration of Human Rights" (UDHR) throughout project. #12 by @regexident. ## [0.3.2] - 2020-04-24 ### Fixed - Fixed implementations of `insert` methods. #10 by @Lukas-Stuehrk ## [0.3.1] - 2020-04-23 ### Fixed - Fixed error caused by missing a case for `CMARK_NODE_DOCUMENT` in `Node.create`. #8 by @mattt. ### Removed - Removed `assertionFailure` in `Node` `cmark_node_type` class property. 1903d99 by @mattt. ## [0.3.0] - 2020-04-10 ### Added - Added implementations of `buildIf` and `buildEither` to `StringBuilder`. #5 by @mattt. ### Changed - **Breaking Change**. Changed `HTML`, renaming it to `RawHTML`. #4 by @mattt. - Changed `Node` to conform to `Codable`. #6 by @mattt. - Changed access level of `Node` from `open` to `public`. #6 by @mattt. - Change access level for APIs referencing `cmark_node` to `internal` #6 by @mattt. - Changed swift-cmark dependency to more recent version. 2239c9c by @mattt. ### Fixed - Fixed error 'Top-level Document encoded as string JSON fragment.' 727e38f by @mattt. ## [0.2.2] - 2020-02-06 ### Fixed - Fixed bug in how closed ranges are constructed from reported source positions. #2 by @mattt. ## [0.2.1] - 2020-01-25 ### Added - Added `ForEach` type to `CommonMarkBuilder` module. 3cee5da by @mattt. - Added implementations of `buildIf` and `buildEither` to `CommonMarkBuilder`. a125d23 by @mattt. - Added convenience initializers to `List` for mapping sequence of values. ec61c45 by @mattt. ### Changed - Changed `List.Item` to allow initialization with `Inline` or `Block` children. c21468c0 by @mattt. - Changed inline types conform to `ListItemConvertible`. ffe900bf by @mattt. - Changed access of children to `public` and conformed them to `Block & Node`. 5e88c519 by @mattt ### Removed - Removed conformance of `Document` to `CustomReflectable`. 6b92588e by @mattt. - Removed `Child` typealias in favor of explicit compound types. c9a5b199 by @mattt. ## [0.2.0] - 2020-01-24 ### Added - Added CommonMarkBuilder interface. 79a98dd by @mattt. ### Changed - Changed access level for `Node` to open. 79a98dd by @mattt. - Changed initialization pattern of `Node`. 79a98dd by @mattt. - Changed `ListItem`, renaming it to `List.Item`. 79a98dd by @mattt. - Changed initializers for `Node` subclasses 79a98dd by @mattt. ### Removed - Removed `BulletList` and `OrderedList`, consolidating them into into a new `List` type. 79a98dd by @mattt. ## [0.1.2] - 2020-01-22 ### Changed - Changed cmark dependency to pin to a tag in a fork. 2f5a2a4 by @mattt. ## [0.1.1] - 2020-01-22 ### Changed - Changed cmark dependency to pin to a specific revision. 90704ff by @mattt. ## [0.1.0] - 2020-01-22 ### Added - Added node creation and mutation functionality. a41ba246 by @mattt. ## [0.0.1] - 2020-01-27 Initial release. [unreleased]: https://github.com/SwiftDocOrg/CommonMark/compare/0.5.1...main [0.5.1]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.5.1 [0.5.0]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.5.0 [0.4.0]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.4.0 [0.3.2]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.3.2 [0.3.1]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.3.1 [0.3.0]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.3.0 [0.2.2]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.2.2 [0.2.1]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.2.1 [0.2.0]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.2.0 [0.1.2]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.1.2 [0.1.1]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.1.1 [0.1.0]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.1.0 [0.0.1]: https://github.com/SwiftDocOrg/CommonMark/releases/tag/0.0.1 ================================================ FILE: LICENSE.md ================================================ Copyright 2019 Read Evaluate Press, LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Makefile ================================================ COMMONMARK_SPEC_VERSION=0.29 Tests/CommonMarkSpecTests: Resources/spec.json | Resources/spec @mkdir -p $@ @for section in $(shell jq -c '.[].section' $< | uniq); do \ filename=`echo "$${section}" | awk -f Resources/camelcase.awk`; \ jq "map(select(.section == \"$${section}\"))" $< > "$|/$${filename}.json" ; \ gyb --line-directive '' -o $@/$${filename}Tests.swift -D filename="$${filename}" Resources/CommonMarkSpecTests.swift.gyb; \ done Resources/spec: @mkdir -p Resources/spec Resources/spec.json: @curl "https://spec.commonmark.org/${COMMONMARK_SPEC_VERSION}/spec.json" > $@ %.swift: %.swift.gyb @gyb --line-directive '' -o $@ $< .PHONY: clean: @rm -f Resources/spec.json @rm -rf Resources/spec @rm -rf Tests/CommonMarkSpecTests ================================================ FILE: Package.resolved ================================================ { "object": { "pins": [ { "package": "cmark", "repositoryURL": "https://github.com/SwiftDocOrg/swift-cmark.git", "state": { "branch": null, "revision": "9c8096a23f44794bde297452d87c455fc4f76d42", "version": "0.29.0+20210102.9c8096a" } } ] }, "version": 1 } ================================================ FILE: Package.swift ================================================ // swift-tools-version:5.1 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "CommonMark", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "CommonMark", targets: ["CommonMark"] ) ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/SwiftDocOrg/swift-cmark.git", from: Version(0, 29, 0, buildMetadataIdentifiers: ["20210102", "9c8096a"])), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "CommonMark", dependencies: ["cmark"] ), .testTarget( name: "CommonMarkTests", dependencies: ["CommonMark"] ), .testTarget( name: "CommonMarkSpecTests", dependencies: ["CommonMark"] ) ] ) ================================================ FILE: README.md ================================================ # CommonMark ![CI][ci badge] [![Documentation][documentation badge]][documentation] A Swift package for working with [CommonMark][commonmark] text. It's built on top of [libcmark][cmark] and fully compliant with the [CommonMark Spec][commonmark]. ## Usage ```swift import CommonMark let markdown = #""" # [Universal Declaration of Human Rights][udhr] ## Article 1. All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood. [udhr]: https://www.un.org/en/universal-declaration-human-rights/ "View full version" """# let document = try Document(markdown) ``` ### Inspecting Document Nodes ```swift document.children.count // 3 let heading = document.children[0] as! Heading heading.headerLevel // 1 heading.children.count // 1 let link = heading.children[0] as! Link link.urlString // "https://www.un.org/en/universal-declaration-human-rights/") link.title // "View full version" let subheading = document.children[1] as! Heading subheading.headerLevel // 2 subheading.children.count // 1 let subheadingText = subheading.children[0] as! Text subheadingText.literal // "Article 1." let paragraph = document.children[2] as! Paragraph paragraph.description // "All human beings [ ... ]" paragraph.range.lowerBound // (line: 5, column: 1) paragraph.range.upperBound // (line: 7, column: 62) ``` ### Rendering to HTML, XML, LaTeX, and Manpage ```swift let html = document.render(format: .html) //
####### foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample34() throws { let markdown = #######""" #5 bolt #hashtag """####### let html = #######"""#5 bolt
#hashtag
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample35() throws { let markdown = #######""" \## foo """####### let html = #######"""## foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample36() throws { let markdown = #######""" # foo *bar* \*baz\* """####### let html = #######"""# foo
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample40() throws {
let markdown = #######"""
foo
# bar
"""#######
let html = #######"""
foo # bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample41() throws { let markdown = #######""" ## foo ## ### bar ### """####### let html = #######"""Foo bar
Bar foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample49() throws { let markdown = #######""" ## # ### ### """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/AutolinksTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecAutolinksTests: XCTestCase { func testExample590() throws { let markdown = #######"""http://foo.bar.baz/test?q=hello&id=22&boolean
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample592() throws { let markdown = #######"""<http://foo.bar/baz bim>
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample599() throws { let markdown = #######"""<foo+@bar.example.com>
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample603() throws { let markdown = #######""" <> """####### let html = #######"""<>
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample604() throws { let markdown = #######""" < http://foo.bar > """####### let html = #######"""< http://foo.bar >
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample605() throws { let markdown = #######"""<m:abc>
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample606() throws { let markdown = #######"""<foo.bar.baz>
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample607() throws { let markdown = #######""" http://example.com """####### let html = #######"""http://example.com
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample608() throws { let markdown = #######""" foo@bar.example.com """####### let html = #######"""foo@bar.example.com
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/BackslashEscapesTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecBackslashEscapesTests: XCTestCase { func testExample298() throws { let markdown = #######""" \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ """####### let html = #######"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample299() throws { let markdown = #######""" \ \A\a\ \3\φ\« """####### let html = #######"""\ \A\a\ \3\φ\«
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample300() throws { let markdown = #######""" \*not emphasized* \*not emphasized* <br/> not a tag [not a link](/foo) `not code` 1. not a list * not a list # not a heading [foo]: /url "not a reference" ö not a character entity
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample301() throws { let markdown = #######""" \\*emphasis* """####### let html = #######"""\emphasis
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample302() throws { let markdown = #######""" foo\ bar """####### let html = #######"""foo
bar
\[\`
\[\]
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample305() throws {
let markdown = #######"""
~~~
\[\]
~~~
"""#######
let html = #######"""
\[\]
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample306() throws {
let markdown = #######"""
foo
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
}
================================================
FILE: Tests/CommonMarkSpecTests/BlankLinesTests.swift
================================================
// This file was automatically generated and should not be edited.
import XCTest
import CommonMark
final class CommonMarkSpecBlankLinesTests: XCTestCase {
func testExample197() throws {
let markdown = #######"""
aaa
# aaa
"""#######
let html = #######"""
aaa
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample199() throws { let markdown = #######""" ># Foo >bar > baz """####### let html = #######"""Foo
bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample200() throws { let markdown = #######""" > # Foo > bar > baz """####### let html = #######"""Foo
bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample201() throws { let markdown = #######""" > # Foo > bar > baz """####### let html = #######"""Foo
bar baz
> # Foo
> bar
> baz
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample202() throws {
let markdown = #######"""
> # Foo
> bar
baz
"""#######
let html = #######"""
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample203() throws { let markdown = #######""" > bar baz > foo """####### let html = #######"""Foo
bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample204() throws { let markdown = #######""" > foo --- """####### let html = #######"""bar baz foo
foo
- foo
foo
bar
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample207() throws {
let markdown = #######"""
> ```
foo
```
"""#######
let html = #######"""
foo
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample208() throws {
let markdown = #######"""
> foo
- bar
"""#######
let html = #######"""
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample209() throws { let markdown = #######""" > """####### let html = #######"""foo - bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample210() throws { let markdown = #######""" > > > """####### let html = #######"""
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample211() throws { let markdown = #######""" > > foo > """####### let html = #######"""
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample212() throws { let markdown = #######""" > foo > bar """####### let html = #######"""foo
foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample213() throws { let markdown = #######""" > foo > bar """####### let html = #######"""bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample214() throws { let markdown = #######""" > foo > > bar """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample215() throws { let markdown = #######""" foo > bar """####### let html = #######"""foo
bar
foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample216() throws { let markdown = #######""" > aaa *** > bbb """####### let html = #######"""bar
aaa
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample217() throws { let markdown = #######""" > bar baz """####### let html = #######"""bbb
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample218() throws { let markdown = #######""" > bar baz """####### let html = #######"""bar baz
bar
baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample219() throws { let markdown = #######""" > bar > baz """####### let html = #######"""bar
baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample220() throws { let markdown = #######""" > > > foo bar """####### let html = #######""""""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample221() throws { let markdown = #######""" >>> foo > bar >>baz """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample222() throws { let markdown = #######""" > code > not code """####### let html = #######"""foo bar baz
code
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/CodeSpansTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecCodeSpansTests: XCTestCase { func testExample328() throws { let markdown = #######""" `foo` """####### let html = #######"""not code
foo
foo ` bar
``
``
a
b
foo bar baz
foo
foo bar baz
foo\bar`
foo`bar
foo `` bar
*foo*
[not a link](/foo)
<a href="">`
<http://foo.bar.baz>`
```foo``
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample348() throws { let markdown = #######""" `foo """####### let html = #######"""`foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample349() throws { let markdown = #######""" `foo``bar`` """####### let html = #######"""`foobar
foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample351() throws { let markdown = #######""" a * foo bar* """####### let html = #######"""a * foo bar*
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample352() throws { let markdown = #######""" a*"foo"* """####### let html = #######"""a*"foo"*
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample353() throws { let markdown = #######""" * a * """####### let html = #######"""* a *
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample354() throws { let markdown = #######""" foo*bar* """####### let html = #######"""foobar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample355() throws { let markdown = #######""" 5*6*78 """####### let html = #######"""5678
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample356() throws { let markdown = #######""" _foo bar_ """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample357() throws { let markdown = #######""" _ foo bar_ """####### let html = #######"""_ foo bar_
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample358() throws { let markdown = #######""" a_"foo"_ """####### let html = #######"""a_"foo"_
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample359() throws { let markdown = #######""" foo_bar_ """####### let html = #######"""foo_bar_
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample360() throws { let markdown = #######""" 5_6_78 """####### let html = #######"""5_6_78
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample361() throws { let markdown = #######""" пристаням_стремятся_ """####### let html = #######"""пристаням_стремятся_
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample362() throws { let markdown = #######""" aa_"bb"_cc """####### let html = #######"""aa_"bb"_cc
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample363() throws { let markdown = #######""" foo-_(bar)_ """####### let html = #######"""foo-(bar)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample364() throws { let markdown = #######""" _foo* """####### let html = #######"""_foo*
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample365() throws { let markdown = #######""" *foo bar * """####### let html = #######"""*foo bar *
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample366() throws { let markdown = #######""" *foo bar * """####### let html = #######"""*foo bar *
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample367() throws { let markdown = #######""" *(*foo) """####### let html = #######"""*(*foo)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample368() throws { let markdown = #######""" *(*foo*)* """####### let html = #######"""(foo)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample369() throws { let markdown = #######""" *foo*bar """####### let html = #######"""foobar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample370() throws { let markdown = #######""" _foo bar _ """####### let html = #######"""_foo bar _
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample371() throws { let markdown = #######""" _(_foo) """####### let html = #######"""_(_foo)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample372() throws { let markdown = #######""" _(_foo_)_ """####### let html = #######"""(foo)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample373() throws { let markdown = #######""" _foo_bar """####### let html = #######"""_foo_bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample374() throws { let markdown = #######""" _пристаням_стремятся """####### let html = #######"""_пристаням_стремятся
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample375() throws { let markdown = #######""" _foo_bar_baz_ """####### let html = #######"""foo_bar_baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample376() throws { let markdown = #######""" _(bar)_. """####### let html = #######"""(bar).
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample377() throws { let markdown = #######""" **foo bar** """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample378() throws { let markdown = #######""" ** foo bar** """####### let html = #######"""** foo bar**
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample379() throws { let markdown = #######""" a**"foo"** """####### let html = #######"""a**"foo"**
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample380() throws { let markdown = #######""" foo**bar** """####### let html = #######"""foobar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample381() throws { let markdown = #######""" __foo bar__ """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample382() throws { let markdown = #######""" __ foo bar__ """####### let html = #######"""__ foo bar__
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample383() throws { let markdown = #######""" __ foo bar__ """####### let html = #######"""__ foo bar__
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample384() throws { let markdown = #######""" a__"foo"__ """####### let html = #######"""a__"foo"__
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample385() throws { let markdown = #######""" foo__bar__ """####### let html = #######"""foo__bar__
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample386() throws { let markdown = #######""" 5__6__78 """####### let html = #######"""5__6__78
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample387() throws { let markdown = #######""" пристаням__стремятся__ """####### let html = #######"""пристаням__стремятся__
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample388() throws { let markdown = #######""" __foo, __bar__, baz__ """####### let html = #######"""foo, bar, baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample389() throws { let markdown = #######""" foo-__(bar)__ """####### let html = #######"""foo-(bar)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample390() throws { let markdown = #######""" **foo bar ** """####### let html = #######"""**foo bar **
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample391() throws { let markdown = #######""" **(**foo) """####### let html = #######"""**(**foo)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample392() throws { let markdown = #######""" *(**foo**)* """####### let html = #######"""(foo)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample393() throws { let markdown = #######""" **Gomphocarpus (*Gomphocarpus physocarpus*, syn. *Asclepias physocarpa*)** """####### let html = #######"""Gomphocarpus (Gomphocarpus physocarpus, syn. Asclepias physocarpa)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample394() throws { let markdown = #######""" **foo "*bar*" foo** """####### let html = #######"""foo "bar" foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample395() throws { let markdown = #######""" **foo**bar """####### let html = #######"""foobar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample396() throws { let markdown = #######""" __foo bar __ """####### let html = #######"""__foo bar __
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample397() throws { let markdown = #######""" __(__foo) """####### let html = #######"""__(__foo)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample398() throws { let markdown = #######""" _(__foo__)_ """####### let html = #######"""(foo)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample399() throws { let markdown = #######""" __foo__bar """####### let html = #######"""__foo__bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample400() throws { let markdown = #######""" __пристаням__стремятся """####### let html = #######"""__пристаням__стремятся
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample401() throws { let markdown = #######""" __foo__bar__baz__ """####### let html = #######"""foo__bar__baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample402() throws { let markdown = #######""" __(bar)__. """####### let html = #######"""(bar).
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample403() throws { let markdown = #######""" *foo [bar](/url)* """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample404() throws { let markdown = #######""" *foo bar* """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample405() throws { let markdown = #######""" _foo __bar__ baz_ """####### let html = #######"""foo bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample406() throws { let markdown = #######""" _foo _bar_ baz_ """####### let html = #######"""foo bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample407() throws { let markdown = #######""" __foo_ bar_ """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample408() throws { let markdown = #######""" *foo *bar** """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample409() throws { let markdown = #######""" *foo **bar** baz* """####### let html = #######"""foo bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample410() throws { let markdown = #######""" *foo**bar**baz* """####### let html = #######"""foobarbaz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample411() throws { let markdown = #######""" *foo**bar* """####### let html = #######"""foo**bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample412() throws { let markdown = #######""" ***foo** bar* """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample413() throws { let markdown = #######""" *foo **bar*** """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample414() throws { let markdown = #######""" *foo**bar*** """####### let html = #######"""foobar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample415() throws { let markdown = #######""" foo***bar***baz """####### let html = #######"""foobarbaz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample416() throws { let markdown = #######""" foo******bar*********baz """####### let html = #######"""foobar***baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample417() throws { let markdown = #######""" *foo **bar *baz* bim** bop* """####### let html = #######"""foo bar baz bim bop
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample418() throws { let markdown = #######""" *foo [*bar*](/url)* """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample419() throws { let markdown = #######""" ** is not an empty emphasis """####### let html = #######"""** is not an empty emphasis
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample420() throws { let markdown = #######""" **** is not an empty strong emphasis """####### let html = #######"""**** is not an empty strong emphasis
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample421() throws { let markdown = #######""" **foo [bar](/url)** """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample422() throws { let markdown = #######""" **foo bar** """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample423() throws { let markdown = #######""" __foo _bar_ baz__ """####### let html = #######"""foo bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample424() throws { let markdown = #######""" __foo __bar__ baz__ """####### let html = #######"""foo bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample425() throws { let markdown = #######""" ____foo__ bar__ """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample426() throws { let markdown = #######""" **foo **bar**** """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample427() throws { let markdown = #######""" **foo *bar* baz** """####### let html = #######"""foo bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample428() throws { let markdown = #######""" **foo*bar*baz** """####### let html = #######"""foobarbaz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample429() throws { let markdown = #######""" ***foo* bar** """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample430() throws { let markdown = #######""" **foo *bar*** """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample431() throws { let markdown = #######""" **foo *bar **baz** bim* bop** """####### let html = #######"""foo bar baz bim bop
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample432() throws { let markdown = #######""" **foo [*bar*](/url)** """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample433() throws { let markdown = #######""" __ is not an empty emphasis """####### let html = #######"""__ is not an empty emphasis
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample434() throws { let markdown = #######""" ____ is not an empty strong emphasis """####### let html = #######"""____ is not an empty strong emphasis
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample435() throws { let markdown = #######""" foo *** """####### let html = #######"""foo ***
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample436() throws { let markdown = #######""" foo *\** """####### let html = #######"""foo *
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample437() throws { let markdown = #######""" foo *_* """####### let html = #######"""foo _
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample438() throws { let markdown = #######""" foo ***** """####### let html = #######"""foo *****
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample439() throws { let markdown = #######""" foo **\*** """####### let html = #######"""foo *
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample440() throws { let markdown = #######""" foo **_** """####### let html = #######"""foo _
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample441() throws { let markdown = #######""" **foo* """####### let html = #######"""*foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample442() throws { let markdown = #######""" *foo** """####### let html = #######"""foo*
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample443() throws { let markdown = #######""" ***foo** """####### let html = #######"""*foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample444() throws { let markdown = #######""" ****foo* """####### let html = #######"""***foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample445() throws { let markdown = #######""" **foo*** """####### let html = #######"""foo*
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample446() throws { let markdown = #######""" *foo**** """####### let html = #######"""foo***
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample447() throws { let markdown = #######""" foo ___ """####### let html = #######"""foo ___
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample448() throws { let markdown = #######""" foo _\__ """####### let html = #######"""foo _
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample449() throws { let markdown = #######""" foo _*_ """####### let html = #######"""foo *
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample450() throws { let markdown = #######""" foo _____ """####### let html = #######"""foo _____
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample451() throws { let markdown = #######""" foo __\___ """####### let html = #######"""foo _
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample452() throws { let markdown = #######""" foo __*__ """####### let html = #######"""foo *
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample453() throws { let markdown = #######""" __foo_ """####### let html = #######"""_foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample454() throws { let markdown = #######""" _foo__ """####### let html = #######"""foo_
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample455() throws { let markdown = #######""" ___foo__ """####### let html = #######"""_foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample456() throws { let markdown = #######""" ____foo_ """####### let html = #######"""___foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample457() throws { let markdown = #######""" __foo___ """####### let html = #######"""foo_
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample458() throws { let markdown = #######""" _foo____ """####### let html = #######"""foo___
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample459() throws { let markdown = #######""" **foo** """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample460() throws { let markdown = #######""" *_foo_* """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample461() throws { let markdown = #######""" __foo__ """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample462() throws { let markdown = #######""" _*foo*_ """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample463() throws { let markdown = #######""" ****foo**** """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample464() throws { let markdown = #######""" ____foo____ """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample465() throws { let markdown = #######""" ******foo****** """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample466() throws { let markdown = #######""" ***foo*** """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample467() throws { let markdown = #######""" _____foo_____ """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample468() throws { let markdown = #######""" *foo _bar* baz_ """####### let html = #######"""foo _bar baz_
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample469() throws { let markdown = #######""" *foo __bar *baz bim__ bam* """####### let html = #######"""foo bar *baz bim bam
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample470() throws { let markdown = #######""" **foo **bar baz** """####### let html = #######"""**foo bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample471() throws { let markdown = #######""" *foo *bar baz* """####### let html = #######"""*foo bar baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample472() throws { let markdown = #######""" *[bar*](/url) """####### let html = #######"""*bar*
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample473() throws { let markdown = #######""" _foo [bar_](/url) """####### let html = #######"""_foo bar_
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample474() throws { let markdown = #######""" **
a *
a _
& © Æ Ď ¾ ℋ ⅆ ∲ ≧̸
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample312() throws { let markdown = #######""" # Ӓ Ϡ """####### let html = #######"""# Ӓ Ϡ �
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample313() throws { let markdown = #######""" " ആ ಫ """####### let html = #######"""" ആ ಫ
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample314() throws { let markdown = #######"""   &x; abcdef0; &ThisIsNotDefined; &hi?; """####### let html = #######"""  &x; &#; &#x; � &#abcdef0; &ThisIsNotDefined; &hi?;
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample315() throws { let markdown = #######""" © """####### let html = #######"""©
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample316() throws { let markdown = #######""" &MadeUpEntity; """####### let html = #######"""&MadeUpEntity;
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample317() throws { let markdown = #######""" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample318() throws { let markdown = #######""" [foo](/föö "föö") """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample319() throws { let markdown = #######""" [foo] [foo]: /föö "föö" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample320() throws { let markdown = #######""" ``` föö foo ``` """####### let html = #######"""foo
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample321() throws {
let markdown = #######"""
`föö`
"""#######
let html = #######"""
föö
föfö
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample323() throws {
let markdown = #######"""
*foo*
*foo*
"""#######
let html = #######"""
*foo* foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample324() throws { let markdown = #######""" * foo * foo """####### let html = #######"""* foo
foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample326() throws { let markdown = #######""" foo """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample327() throws { let markdown = #######""" [a](url "tit") """####### let html = #######"""[a](url "tit")
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/FencedCodeBlocksTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecFencedCodeBlocksTests: XCTestCase { func testExample89() throws { let markdown = #######""" ``` < > ``` """####### let html = #######"""<
>
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample90() throws {
let markdown = #######"""
~~~
<
>
~~~
"""#######
let html = #######"""
<
>
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample91() throws {
let markdown = #######"""
``
foo
``
"""#######
let html = #######"""
foo
aaa
~~~
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample93() throws {
let markdown = #######"""
~~~
aaa
```
~~~
"""#######
let html = #######"""
aaa
```
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample94() throws {
let markdown = #######"""
````
aaa
```
``````
"""#######
let html = #######"""
aaa
```
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample95() throws {
let markdown = #######"""
~~~~
aaa
~~~
~~~~
"""#######
let html = #######"""
aaa
~~~
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample96() throws {
let markdown = #######"""
```
"""#######
let html = #######"""
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample97() throws {
let markdown = #######"""
`````
```
aaa
"""#######
let html = #######"""
```
aaa
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample98() throws {
let markdown = #######"""
> ```
> aaa
bbb
"""#######
let html = #######"""
aaa
bbb
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample99() throws { let markdown = #######""" ``` ``` """####### let html = #######"""
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample100() throws {
let markdown = #######"""
```
```
"""#######
let html = #######"""
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample101() throws {
let markdown = #######"""
```
aaa
aaa
```
"""#######
let html = #######"""
aaa
aaa
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample102() throws {
let markdown = #######"""
```
aaa
aaa
aaa
```
"""#######
let html = #######"""
aaa
aaa
aaa
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample103() throws {
let markdown = #######"""
```
aaa
aaa
aaa
```
"""#######
let html = #######"""
aaa
aaa
aaa
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample104() throws {
let markdown = #######"""
```
aaa
```
"""#######
let html = #######"""
```
aaa
```
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample105() throws {
let markdown = #######"""
```
aaa
```
"""#######
let html = #######"""
aaa
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample106() throws {
let markdown = #######"""
```
aaa
```
"""#######
let html = #######"""
aaa
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample107() throws {
let markdown = #######"""
```
aaa
```
"""#######
let html = #######"""
aaa
```
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample108() throws {
let markdown = #######"""
``` ```
aaa
"""#######
let html = #######"""
aaa
aaa
~~~ ~~
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample110() throws {
let markdown = #######"""
foo
```
bar
```
baz
"""#######
let html = #######"""
foo
bar
baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample111() throws { let markdown = #######""" foo --- ~~~ bar ~~~ # baz """####### let html = #######"""bar
def foo(x)
return 3
end
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample113() throws {
let markdown = #######"""
~~~~ ruby startline=3 $%@#$
def foo(x)
return 3
end
~~~~~~~
"""#######
let html = #######"""
def foo(x)
return 3
end
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample114() throws {
let markdown = #######"""
````;
````
"""#######
let html = #######"""
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample115() throws {
let markdown = #######"""
``` aa ```
foo
"""#######
let html = #######"""
aa
foo
foo
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample117() throws {
let markdown = #######"""
```
``` aaa
```
"""#######
let html = #######"""
``` aaa
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
}
================================================
FILE: Tests/CommonMarkSpecTests/HardLineBreaksTests.swift
================================================
// This file was automatically generated and should not be edited.
import XCTest
import CommonMark
final class CommonMarkSpecHardLineBreaksTests: XCTestCase {
func testExample630() throws {
let markdown = #######"""
foo
baz
"""#######
let html = #######"""
foo
baz
foo
baz
foo
baz
foo
bar
foo
bar
foo
bar
foo
bar
code span
code\ span
foo\
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample642() throws { let markdown = #######""" foo """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample643() throws { let markdown = #######""" ### foo\ """####### let html = #######"""
**Hello**,
_world_.
|
**Hello**,
|
| hi |
| hi |
okay.
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample120() throws { let markdown = #######""" *foo* """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample122() throws { let markdown = #######"""Markdown
bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample126() throws { let markdown = #######""" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample130() throws { let markdown = #######"""| foo |
| foo |
foo
foo
import Text.HTML.TagSoup
main :: IO ()
main = print $ parseTags tags
okay
"""#######
let html = #######"""
import Text.HTML.TagSoup
main :: IO ()
main = print $ parseTags tags
okay
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample140() throws { let markdown = #######""" okay """####### let html = #######"""okay
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample141() throws { let markdown = #######""" okay """####### let html = #######"""okay
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample142() throws { let markdown = #######""" *foo* """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample146() throws { let markdown = #######""" *bar* *baz* """####### let html = #######""" *bar*baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample147() throws { let markdown = #######""" 1. *bar* """####### let html = #######""" 1. *bar* """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample148() throws { let markdown = #######""" okay """####### let html = #######"""okay
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample149() throws { let markdown = #######""" '; ?> okay """####### let html = #######""" '; ?>okay
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample150() throws { let markdown = #######""" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample151() throws { let markdown = #######""" okay """####### let html = #######"""okay
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample152() throws { let markdown = #######""" """####### let html = #######"""<!-- foo -->
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample153() throws {
let markdown = #######"""
<div>
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample154() throws {
let markdown = #######"""
Foo
Foo
Foo baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample157() throws { let markdown = #######"""Emphasized text.
| Hi |
| Hi |
| Hi |




My 
[]
![[foo]]
[[foo]]: /url "title"
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample587() throws { let markdown = #######""" ![Foo] [foo]: /url "title" """####### let html = #######"""![foo]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample589() throws { let markdown = #######""" \![foo] [foo]: /url "title" """####### let html = #######"""!foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/IndentedCodeBlocksTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecIndentedCodeBlocksTests: XCTestCase { func testExample77() throws { let markdown = #######""" a simple indented code block """####### let html = #######"""a simple
indented code block
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample78() throws {
let markdown = #######"""
- foo
bar
"""#######
let html = #######"""
foo
bar
foo
<a/>
*hi*
- one
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample81() throws {
let markdown = #######"""
chunk1
chunk2
chunk3
"""#######
let html = #######"""
chunk1
chunk2
chunk3
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample82() throws {
let markdown = #######"""
chunk1
chunk2
"""#######
let html = #######"""
chunk1
chunk2
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample83() throws {
let markdown = #######"""
Foo
bar
"""#######
let html = #######"""
Foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample84() throws { let markdown = #######""" foo bar """####### let html = #######"""foo
bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample85() throws { let markdown = #######""" # Heading foo Heading ------ foo ---- """####### let html = #######"""foo
foo
foo
bar
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample87() throws {
let markdown = #######"""
foo
"""#######
let html = #######"""
foo
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample88() throws {
let markdown = #######"""
foo
"""#######
let html = #######"""
foo
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
}
================================================
FILE: Tests/CommonMarkSpecTests/InlinesTests.swift
================================================
// This file was automatically generated and should not be edited.
import XCTest
import CommonMark
final class CommonMarkSpecInlinesTests: XCTestCase {
func testExample297() throws {
let markdown = #######"""
`hi`lo`
"""#######
let html = #######"""
hilo`
[foo]: /url 'title
with blank line'
[foo]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample167() throws { let markdown = #######""" [foo]: /url [foo] """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample168() throws { let markdown = #######""" [foo]: [foo] """####### let html = #######"""[foo]:
[foo]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample169() throws { let markdown = #######""" [foo]: <> [foo] """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample170() throws { let markdown = #######""" [foo]:[foo]:
[foo]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample171() throws { let markdown = #######""" [foo]: /url\bar\*baz "foo\"bar\baz" [foo] """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample172() throws { let markdown = #######""" [foo] [foo]: url """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample173() throws { let markdown = #######""" [foo] [foo]: first [foo]: second """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample174() throws { let markdown = #######""" [FOO]: /url [Foo] """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample175() throws { let markdown = #######""" [ΑΓΩ]: /φου [αγω] """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample176() throws { let markdown = #######""" [foo]: /url """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample177() throws { let markdown = #######""" [ foo ]: /url bar """####### let html = #######"""bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample178() throws { let markdown = #######""" [foo]: /url "title" ok """####### let html = #######"""[foo]: /url "title" ok
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample179() throws { let markdown = #######""" [foo]: /url "title" ok """####### let html = #######""""title" ok
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample180() throws { let markdown = #######""" [foo]: /url "title" [foo] """####### let html = #######"""[foo]: /url "title"
[foo]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample181() throws { let markdown = #######""" ``` [foo]: /url ``` [foo] """####### let html = #######"""[foo]: /url
[foo]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample182() throws { let markdown = #######""" Foo [bar]: /baz [bar] """####### let html = #######"""Foo [bar]: /baz
[bar]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample183() throws { let markdown = #######""" # [Foo] [foo]: /url > bar """####### let html = #######""""""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample184() throws { let markdown = #######""" [foo]: /url bar === [foo] """####### let html = #######"""bar
=== foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample186() throws { let markdown = #######""" [foo]: /foo-url "foo" [bar]: /bar-url "bar" [baz]: /baz-url [foo], [bar], [baz] """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample187() throws { let markdown = #######""" [foo] > [foo]: /url """####### let html = #######""""""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample188() throws { let markdown = #######""" [foo]: /url """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/LinksTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecLinksTests: XCTestCase { func testExample481() throws { let markdown = #######""" [link](/uri "title") """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample482() throws { let markdown = #######""" [link](/uri) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample483() throws { let markdown = #######""" [link]() """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample484() throws { let markdown = #######""" [link](<>) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample485() throws { let markdown = #######""" [link](/my uri) """####### let html = #######"""
[link](/my uri)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample486() throws { let markdown = #######""" [link]([link](foo bar)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample488() throws { let markdown = #######""" [link]([link](
[link](<foo>)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample491() throws { let markdown = #######""" [a]( [a](c) """####### let html = #######"""[a](<b)c [a](<b)c> [a](c)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample492() throws { let markdown = #######""" [link](\(foo\)) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample493() throws { let markdown = #######""" [link](foo(and(bar))) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample494() throws { let markdown = #######""" [link](foo\(and\(bar\)) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample495() throws { let markdown = #######""" [link]([link](/url "title "and" title")
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample505() throws { let markdown = #######""" [link](/url 'title "and" title') """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample506() throws { let markdown = #######""" [link]( /uri "title" ) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample507() throws { let markdown = #######""" [link] (/uri) """####### let html = #######"""[link] (/uri)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample508() throws { let markdown = #######""" [link [foo [bar]]](/uri) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample509() throws { let markdown = #######""" [link] bar](/uri) """####### let html = #######"""[link] bar](/uri)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample510() throws { let markdown = #######""" [link [bar](/uri) """####### let html = #######"""[link bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample511() throws { let markdown = #######""" [link \[bar](/uri) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample512() throws { let markdown = #######""" [link *foo **bar** `#`*](/uri) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample513() throws { let markdown = #######""" [](/uri) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample514() throws { let markdown = #######""" [foo [bar](/uri)](/uri) """####### let html = #######"""[foo bar](/uri)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample515() throws { let markdown = #######""" [foo *[bar [baz](/uri)](/uri)*](/uri) """####### let html = #######"""[foo [bar baz](/uri)](/uri)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample516() throws { let markdown = #######""" ](uri2)](uri3) """####### let html = #######"""*foo*
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample518() throws { let markdown = #######""" [foo *bar](baz*) """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample519() throws { let markdown = #######""" *foo [bar* baz] """####### let html = #######"""foo [bar baz]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample520() throws { let markdown = #######""" [foo[foo
[foo](/uri)
[foohttp://example.com/?search=](uri)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample523() throws { let markdown = #######""" [foo][bar] [bar]: /url "title" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample524() throws { let markdown = #######""" [link [foo [bar]]][ref] [ref]: /uri """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample525() throws { let markdown = #######""" [link \[bar][ref] [ref]: /uri """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample526() throws { let markdown = #######""" [link *foo **bar** `#`*][ref] [ref]: /uri """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample527() throws { let markdown = #######""" [][ref] [ref]: /uri """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample528() throws { let markdown = #######""" [foo [bar](/uri)][ref] [ref]: /uri """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample529() throws { let markdown = #######""" [foo *bar [baz][ref]*][ref] [ref]: /uri """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample530() throws { let markdown = #######""" *[foo*][ref] [ref]: /uri """####### let html = #######"""*foo*
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample531() throws { let markdown = #######""" [foo *bar][ref] [ref]: /uri """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample532() throws { let markdown = #######""" [foo[foo
[foo][ref]
[foohttp://example.com/?search=][ref]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample535() throws { let markdown = #######""" [foo][BaR] [bar]: /url "title" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample536() throws { let markdown = #######""" [Толпой][Толпой] is a Russian word. [ТОЛПОЙ]: /url """####### let html = #######"""Толпой is a Russian word.
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample537() throws { let markdown = #######""" [Foo bar]: /url [Baz][Foo bar] """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample538() throws { let markdown = #######""" [foo] [bar] [bar]: /url "title" """####### let html = #######"""[foo] bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample539() throws { let markdown = #######""" [foo] [bar] [bar]: /url "title" """####### let html = #######"""[foo] bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample540() throws { let markdown = #######""" [foo]: /url1 [foo]: /url2 [bar][foo] """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample541() throws { let markdown = #######""" [bar][foo\!] [foo!]: /url """####### let html = #######"""[bar][foo!]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample542() throws { let markdown = #######""" [foo][ref[] [ref[]: /uri """####### let html = #######"""[foo][ref[]
[ref[]: /uri
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample543() throws { let markdown = #######""" [foo][ref[bar]] [ref[bar]]: /uri """####### let html = #######"""[foo][ref[bar]]
[ref[bar]]: /uri
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample544() throws { let markdown = #######""" [[[foo]]] [[[foo]]]: /url """####### let html = #######"""[[[foo]]]
[[[foo]]]: /url
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample545() throws { let markdown = #######""" [foo][ref\[] [ref\[]: /uri """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample546() throws { let markdown = #######""" [bar\\]: /uri [bar\\] """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample547() throws { let markdown = #######""" [] []: /uri """####### let html = #######"""[]
[]: /uri
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample548() throws { let markdown = #######""" [ ] [ ]: /uri """####### let html = #######"""[ ]
[ ]: /uri
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample549() throws { let markdown = #######""" [foo][] [foo]: /url "title" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample550() throws { let markdown = #######""" [*foo* bar][] [*foo* bar]: /url "title" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample551() throws { let markdown = #######""" [Foo][] [foo]: /url "title" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample552() throws { let markdown = #######""" [foo] [] [foo]: /url "title" """####### let html = #######"""foo []
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample553() throws { let markdown = #######""" [foo] [foo]: /url "title" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample554() throws { let markdown = #######""" [*foo* bar] [*foo* bar]: /url "title" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample555() throws { let markdown = #######""" [[*foo* bar]] [*foo* bar]: /url "title" """####### let html = #######"""[foo bar]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample556() throws { let markdown = #######""" [[bar [foo] [foo]: /url """####### let html = #######"""[[bar foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample557() throws { let markdown = #######""" [Foo] [foo]: /url "title" """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample558() throws { let markdown = #######""" [foo] bar [foo]: /url """####### let html = #######"""foo bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample559() throws { let markdown = #######""" \[foo] [foo]: /url "title" """####### let html = #######"""[foo]
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample560() throws { let markdown = #######""" [foo*]: /url *[foo*] """####### let html = #######"""*foo*
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample561() throws { let markdown = #######""" [foo][bar] [foo]: /url1 [bar]: /url2 """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample562() throws { let markdown = #######""" [foo][] [foo]: /url1 """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample563() throws { let markdown = #######""" [foo]() [foo]: /url1 """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample564() throws { let markdown = #######""" [foo](not a link) [foo]: /url1 """####### let html = #######"""foo(not a link)
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample565() throws { let markdown = #######""" [foo][bar][baz] [baz]: /url """####### let html = #######"""[foo]bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample566() throws { let markdown = #######""" [foo][bar][baz] [baz]: /url1 [bar]: /url2 """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample567() throws { let markdown = #######""" [foo][bar][baz] [baz]: /url1 [foo]: /url2 """####### let html = #######"""[foo]bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/ListItemsTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecListItemsTests: XCTestCase { func testExample223() throws { let markdown = #######""" A paragraph with two lines. indented code > A block quote. """####### let html = #######"""A paragraph with two lines.
indented code
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample224() throws { let markdown = #######""" 1. A paragraph with two lines. indented code > A block quote. """####### let html = #######"""A block quote.
A paragraph with two lines.
indented code
A block quote.
two
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample226() throws { let markdown = #######""" - one two """####### let html = #######"""one
two
two
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample228() throws {
let markdown = #######"""
- one
two
"""#######
let html = #######"""
one
two
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample230() throws { let markdown = #######""" >>- one >> > > two """####### let html = #######"""
one
two
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample231() throws { let markdown = #######""" -one 2.two """####### let html = #######"""
- one
two
-one
2.two
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample232() throws { let markdown = #######""" - foo bar """####### let html = #######"""foo
bar
foo
bar
baz
bam
Foo
bar
baz
1234567890. not ok
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample237() throws { let markdown = #######""" 0. ok """####### let html = #######"""-1. not ok
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample240() throws { let markdown = #######""" - foo bar """####### let html = #######"""foo
bar
foo
bar
indented code
paragraph
more code
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample243() throws {
let markdown = #######"""
1. indented code
paragraph
more code
"""#######
let html = #######"""
indented code
paragraph
more code
indented code
paragraph
more code
foo
bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample246() throws { let markdown = #######""" - foo bar """####### let html = #######"""bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample247() throws { let markdown = #######""" - foo bar """####### let html = #######"""foo
bar
bar
baz
foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample251() throws { let markdown = #######""" - foo - - bar """####### let html = #######"""foo *
foo 1.
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample256() throws { let markdown = #######""" 1. A paragraph with two lines. indented code > A block quote. """####### let html = #######"""A paragraph with two lines.
indented code
A block quote.
A paragraph with two lines.
indented code
A block quote.
A paragraph with two lines.
indented code
A block quote.
1. A paragraph
with two lines.
indented code
> A block quote.
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample260() throws {
let markdown = #######"""
1. A paragraph
with two lines.
indented code
> A block quote.
"""#######
let html = #######"""
A paragraph with two lines.
indented code
A block quote.
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample263() throws { let markdown = #######""" > 1. > Blockquote > continued here. """####### let html = #######"""
Blockquote continued here.
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample264() throws { let markdown = #######""" - foo - bar - baz - boo """####### let html = #######"""
Blockquote continued here.
Foo
The number of windows in my house is 14. The number of doors is 6.
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample275() throws { let markdown = #######""" The number of windows in my house is 1. The number of doors is 6. """####### let html = #######"""The number of windows in my house is
foo
bar
baz
baz
bim
foo
notcode
foo
code
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample280() throws {
let markdown = #######"""
- a
- b
- c
- d
- e
- f
- g
"""#######
let html = #######"""
a
b
c
a
b
3. c
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample284() throws {
let markdown = #######"""
- a
- b
- c
"""#######
let html = #######"""
a
b
c
a
c
a
b
c
d
a
b
d
b
b
c
b
b
c
foo
bar
foo
baz
a
d
aaa
bbb
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample190() throws { let markdown = #######""" aaa bbb ccc ddd """####### let html = #######"""aaa bbb
ccc ddd
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample191() throws { let markdown = #######""" aaa bbb """####### let html = #######"""aaa
bbb
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample192() throws { let markdown = #######""" aaa bbb """####### let html = #######"""aaa bbb
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample193() throws { let markdown = #######""" aaa bbb ccc """####### let html = #######"""aaa bbb ccc
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample194() throws { let markdown = #######""" aaa bbb """####### let html = #######"""aaa bbb
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample195() throws { let markdown = #######""" aaa bbb """####### let html = #######"""aaa
bbb
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample196() throws { let markdown = #######""" aaa bbb """####### let html = #######"""aaa
bbb
Foo
<33> <__>
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample615() throws { let markdown = #######""" """####### let html = #######"""<a h*#ref="hi">
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample616() throws { let markdown = #######""" <a href="hi'> <a href=hi'> """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample617() throws { let markdown = #######""" < a>< foo>< a>< foo><bar/ > <foo bar=baz bim!bop />
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample618() throws { let markdown = #######""" """####### let html = #######"""<a href='bar'title=title>
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample619() throws { let markdown = #######"""</a href="foo">
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample621() throws { let markdown = #######""" foo """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample622() throws { let markdown = #######""" foo """####### let html = #######"""foo <!-- not a comment -- two hyphens -->
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample623() throws { let markdown = #######""" foo foo --> foo """####### let html = #######"""foo <!--> foo -->
foo <!-- foo--->
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample624() throws { let markdown = #######""" foo """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample625() throws { let markdown = #######""" foo """####### let html = #######"""foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample626() throws { let markdown = #######""" foo &<]]> """####### let html = #######"""foo &<]]>
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample627() throws { let markdown = #######""" foo """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample628() throws { let markdown = #######""" foo """####### let html = #######""" """####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample629() throws { let markdown = #######""" """####### let html = #######"""<a href=""">
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/SetextHeadingsTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecSetextHeadingsTests: XCTestCase { func testExample50() throws { let markdown = #######""" Foo *bar* ========= Foo *bar* --------- """####### let html = #######"""Foo
---
Foo
Foo ---
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample58() throws { let markdown = #######""" Foo = = Foo --- - """####### let html = #######"""Foo = =
Foo
`
of dashes"/>
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample62() throws { let markdown = #######""" > Foo --- """####### let html = #######"""Foo
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample64() throws { let markdown = #######""" - Foo --- """####### let html = #######"""foo bar ===
Baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample67() throws { let markdown = #######""" ==== """####### let html = #######"""====
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample68() throws { let markdown = #######""" --- --- """####### let html = #######"""foo
foo
Foo
baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample74() throws { let markdown = #######""" Foo bar --- baz """####### let html = #######"""Foo bar
baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample75() throws { let markdown = #######""" Foo bar * * * baz """####### let html = #######"""Foo bar
baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample76() throws { let markdown = #######""" Foo bar \--- baz """####### let html = #######"""Foo bar --- baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/SoftLineBreaksTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecSoftLineBreaksTests: XCTestCase { func testExample645() throws { let markdown = #######""" foo baz """####### let html = #######"""foo baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample646() throws { let markdown = #######""" foo baz """####### let html = #######"""foo baz
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/TabsTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecTabsTests: XCTestCase { func testExample1() throws { let markdown = #######""" foo baz bim """####### let html = #######"""foo baz bim
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample2() throws {
let markdown = #######"""
foo baz bim
"""#######
let html = #######"""
foo baz bim
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample3() throws {
let markdown = #######"""
a a
ὐ a
"""#######
let html = #######"""
a a
ὐ a
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample4() throws {
let markdown = #######"""
- foo
bar
"""#######
let html = #######"""
foo
bar
foo
bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample7() throws { let markdown = #######""" - foo """####### let html = #######"""foo
foo
foo
bar
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample9() throws {
let markdown = #######"""
- foo
- bar
- baz
"""#######
let html = #######"""
hello $.;'there
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample648() throws { let markdown = #######""" Foo χρῆν """####### let html = #######"""Foo χρῆν
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample649() throws { let markdown = #######""" Multiple spaces """####### let html = #######"""Multiple spaces
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } } ================================================ FILE: Tests/CommonMarkSpecTests/ThematicBreaksTests.swift ================================================ // This file was automatically generated and should not be edited. import XCTest import CommonMark final class CommonMarkSpecThematicBreaksTests: XCTestCase { func testExample13() throws { let markdown = #######""" *** --- ___ """####### let html = #######"""+++
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample15() throws { let markdown = #######""" === """####### let html = #######"""===
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample16() throws { let markdown = #######""" -- ** __ """####### let html = #######"""-- ** __
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample17() throws { let markdown = #######""" *** *** *** """####### let html = #######"""***
"""#######
let document = try Document(markdown)
let actual = document.render(format: .html, options: [.unsafe])
let expected = html
XCTAssertEqual(actual, expected)
}
func testExample19() throws {
let markdown = #######"""
Foo
***
"""#######
let html = #######"""
Foo ***
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample20() throws { let markdown = #######""" _____________________________________ """####### let html = #######"""_ _ _ _ a
a------
---a---
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample26() throws { let markdown = #######""" *-* """####### let html = #######"""-
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample27() throws { let markdown = #######""" - foo *** - bar """####### let html = #######"""Foo
bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample29() throws { let markdown = #######""" Foo --- bar """####### let html = #######"""bar
"""####### let document = try Document(markdown) let actual = document.render(format: .html, options: [.unsafe]) let expected = html XCTAssertEqual(actual, expected) } func testExample30() throws { let markdown = #######""" * Foo * * * * Bar """####### let html = #######"""All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.
"""# XCTAssertEqual(actual, expected) } func testNodeHTMLRendering() throws { let document = try Document(Fixtures.udhr) let actual = document.render(format: .html) let expected = document.children.map { $0.render(format: .html) }.joined() XCTAssertEqual(actual, expected) } func testDocumentXMLRendering() throws { let document = try Document(Fixtures.udhr) let actual = document.render(format: .xml) let expected = #"""