Compare commits

...

19 Commits

Author SHA1 Message Date
Rob Phillips 7e35685b62 Bump version, update README 2017-02-25 21:02:42 -08:00
rob phillips 438db717be Merge pull request #24 from invliD/tvos
Add tvOS support
2017-02-25 20:53:34 -08:00
Sebastian Brückner 309457311d Add tvOS to podspec 2017-02-25 19:13:03 -08:00
Sebastian Brückner e02770d6cf Add tvOS target 2017-02-25 18:32:33 -08:00
Sebastian Brückner 6e9badef42 Rename iOS target 2017-02-25 18:08:41 -08:00
rob phillips 11e757b99a Merge pull request #22 from iwasrobbed/downview
v0.3.1: Add the ability to update DownView content
2017-02-09 17:39:10 -08:00
Rob Phillips 761e90384b Add issue template to prevent dupes 2017-02-09 14:02:54 -08:00
Rob Phillips 9d36403189 Add changelog 2017-02-09 13:57:10 -08:00
Rob Phillips 2a240a1224 v0.3.1: Add the ability to update DownView content 2017-02-09 13:46:36 -08:00
rob phillips 3131e3bfb5 Add Carthage support (thanks to mbuchetics) 2016-11-09 20:15:56 -08:00
Rob Phillips 92ef17a63a Bump pod to v0.3 2016-10-12 15:05:14 -07:00
rob phillips 95a8027744 Merge pull request #11 from azeff/swift-3
Swift 3
2016-10-12 14:58:14 -07:00
Evgeny Kazakov f8e87aeb01 Travis config: use osx image with Xcode 8 2016-10-12 23:42:16 +03:00
Evgeny Kazakov fc5dfcc53f Use cmark's defines for options enum 2016-10-12 17:17:00 +03:00
Evgeny Kazakov d193007caf Swift 3 support 2016-10-12 17:16:52 +03:00
rob phillips ae3161caa5 Manual installation 2016-06-02 15:10:44 -07:00
rob phillips e11e164450 Merge pull request #7 from iwasrobbed/tests
Adds a few extra tests where possible
2016-06-02 14:49:36 -07:00
rob phillips af887d9c8d Adds a few extra tests where possible 2016-06-02 14:36:27 -07:00
rob phillips a410f58f78 Merge pull request #5 from iwasrobbed/downview
DownView rendering to close #3
2016-06-02 09:30:44 -07:00
26 changed files with 738 additions and 174 deletions
+19
View File
@@ -0,0 +1,19 @@
Please help prevent duplicate issues before submitting a new one:
* [ ] I've searched other open/closed issues for duplicates before opening up this new issue.
# Report
## What did you do?
Please replace this with what you did.
## What did you expect to happen?
Please replace this with what you expected to happen.
## What happened instead?
Please replace this with what happened instead (e.g. the issue).
+1
View File
@@ -0,0 +1 @@
3.0
+3 -3
View File
@@ -1,9 +1,9 @@
osx_image: xcode7.3
osx_image: xcode8
language: objective-c
before_install:
- gem install xcpretty slather -N
- xcrun instruments -w "iPhone 5 (9.3)" || echo "(Pre)Launched the simulator."
script:
- set -o pipefail && xcodebuild test -project Down.xcodeproj -scheme "Down" -destination "platform=iOS Simulator,name=iPhone 5,OS=9.3" -enableCodeCoverage YES ONLY_ACTIVE_ARCH=YES | xcpretty -c
- set -o pipefail && xcodebuild test -project Down.xcodeproj -scheme "Down-iOS" -destination "platform=iOS Simulator,name=iPhone 5,OS=9.3" -enableCodeCoverage YES ONLY_ACTIVE_ARCH=YES | xcpretty -c
after_success:
- slather coverage --ignore "../**/*/Xcode*" --ignore "Source/cmark/*" --scheme "Down" Down.xcodeproj
- slather coverage --ignore "../**/*/Xcode*" --ignore "Source/cmark/*" --scheme "Down-iOS" Down.xcodeproj
+62
View File
@@ -0,0 +1,62 @@
# Change Log
## [Unreleased](https://github.com/iwasrobbed/Down/tree/HEAD)
[Full Changelog](https://github.com/iwasrobbed/Down/compare/v0.3.1...HEAD)
**Closed issues:**
- How to update DownView content and keep the style? [\#19](https://github.com/iwasrobbed/Down/issues/19)
## [v0.3.1](https://github.com/iwasrobbed/Down/tree/v0.3.1) (2017-02-09)
[Full Changelog](https://github.com/iwasrobbed/Down/compare/v0.3...v0.3.1)
**Closed issues:**
- How to keep UITextView font style [\#21](https://github.com/iwasrobbed/Down/issues/21)
- Define custom fonts [\#18](https://github.com/iwasrobbed/Down/issues/18)
- Render progress [\#17](https://github.com/iwasrobbed/Down/issues/17)
- Disable zoom WebView [\#16](https://github.com/iwasrobbed/Down/issues/16)
- Text Size of DownView too small [\#15](https://github.com/iwasrobbed/Down/issues/15)
- How to customize the Font? [\#14](https://github.com/iwasrobbed/Down/issues/14)
- Support Images [\#13](https://github.com/iwasrobbed/Down/issues/13)
- How to manually install \(w/o Carthage or CocoaPods\) [\#12](https://github.com/iwasrobbed/Down/issues/12)
- Add support for Carthage [\#8](https://github.com/iwasrobbed/Down/issues/8)
## [v0.3](https://github.com/iwasrobbed/Down/tree/v0.3) (2016-10-12)
[Full Changelog](https://github.com/iwasrobbed/Down/compare/v0.2...v0.3)
**Implemented enhancements:**
- Swift 3.0 support [\#10](https://github.com/iwasrobbed/Down/issues/10)
- Add web view for rendering output [\#3](https://github.com/iwasrobbed/Down/issues/3)
**Closed issues:**
- Can you give an example how to custom the parser? [\#9](https://github.com/iwasrobbed/Down/issues/9)
**Merged pull requests:**
- Swift 3 [\#11](https://github.com/iwasrobbed/Down/pull/11) ([azeff](https://github.com/azeff))
- Adds a few extra tests where possible [\#7](https://github.com/iwasrobbed/Down/pull/7) ([iwasrobbed](https://github.com/iwasrobbed))
- DownView rendering to close \#3 [\#5](https://github.com/iwasrobbed/Down/pull/5) ([iwasrobbed](https://github.com/iwasrobbed))
## [v0.2](https://github.com/iwasrobbed/Down/tree/v0.2) (2016-06-02)
[Full Changelog](https://github.com/iwasrobbed/Down/compare/v0.1.1...v0.2)
**Implemented enhancements:**
- Add attributed string support [\#2](https://github.com/iwasrobbed/Down/issues/2)
- Adds attributed string rendering [\#4](https://github.com/iwasrobbed/Down/pull/4) ([iwasrobbed](https://github.com/iwasrobbed))
## [v0.1.1](https://github.com/iwasrobbed/Down/tree/v0.1.1) (2016-06-01)
[Full Changelog](https://github.com/iwasrobbed/Down/compare/v0.1...v0.1.1)
**Implemented enhancements:**
- Add CocoaPods support & cmark license [\#1](https://github.com/iwasrobbed/Down/pull/1) ([iwasrobbed](https://github.com/iwasrobbed))
## [v0.1](https://github.com/iwasrobbed/Down/tree/v0.1) (2016-06-01)
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
+7 -5
View File
@@ -1,17 +1,19 @@
Pod::Spec.new do |spec|
spec.name = "Down"
spec.summary = "Blazing fast Markdown rendering in Swift, built upon cmark."
spec.version = "0.2"
spec.version = "0.3.2"
spec.homepage = "https://github.com/iwasrobbed/Down"
spec.license = { :type => "MIT", :file => "LICENSE" }
spec.authors = { "Rob Phillips" => "rob@desideratalabs.co" }
spec.source = { :git => "https://github.com/iwasrobbed/Down.git", :tag => "v" + spec.version.to_s }
spec.source_files = "Source/**/*"
spec.source_files = "Source/{cmark,Enums & Options,Extensions,Renderers}/**", "Source/*"
spec.ios.source_files = "Source/Views/**"
spec.public_header_files = "Source/*.h"
spec.platform = :ios, "8.0"
spec.ios.deployment_target = "8.0"
spec.tvos.deployment_target = "9.0"
spec.requires_arc = true
spec.module_name = "Down"
spec.preserve_path = 'Source/cmark/module.modulemap'
spec.pod_target_xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$(SRCROOT)/Down/Source/cmark/**' }
spec.resource = 'Resources/DownView.bundle'
end
spec.ios.resource = 'Resources/DownView.bundle'
end
+252 -16
View File
@@ -7,6 +7,56 @@
objects = {
/* Begin PBXBuildFile section */
24F833B41E6271D200590E90 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F031CFA5D63008EEC6E /* config.h */; };
24F833B51E6271D900590E90 /* scanners.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F1B1CFA5D63008EEC6E /* scanners.h */; };
24F833B61E6271E000590E90 /* render.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F191CFA5D63008EEC6E /* render.h */; };
24F833B71E6271E700590E90 /* cmark_export.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F001CFA5D63008EEC6E /* cmark_export.h */; };
24F833B81E6271EE00590E90 /* parser.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F151CFA5D63008EEC6E /* parser.h */; };
24F833B91E6271F400590E90 /* inlines.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F0D1CFA5D63008EEC6E /* inlines.h */; };
24F833BA1E6271FB00590E90 /* buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201EF91CFA5D63008EEC6E /* buffer.h */; };
24F833BB1E62720300590E90 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F041CFA5D63008EEC6E /* debug.h */; };
24F833BC1E62720A00590E90 /* chunk.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201EFB1CFA5D63008EEC6E /* chunk.h */; };
24F833BD1E62721100590E90 /* references.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F171CFA5D63008EEC6E /* references.h */; };
24F833BE1E62721700590E90 /* utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F1D1CFA5D63008EEC6E /* utf8.h */; };
24F833BF1E62721E00590E90 /* cmark_version.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F011CFA5D63008EEC6E /* cmark_version.h */; };
24F833C01E62722500590E90 /* html_unescape.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F0B1CFA5D63008EEC6E /* html_unescape.h */; };
24F833C11E62723000590E90 /* cmark_ctype.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201EFF1CFA5D63008EEC6E /* cmark_ctype.h */; };
24F833C21E62723600590E90 /* iterator.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F0F1CFA5D63008EEC6E /* iterator.h */; };
24F833C31E62723E00590E90 /* houdini.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F061CFA5D63008EEC6E /* houdini.h */; };
24F833C41E62724600590E90 /* cmark.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201EFD1CFA5D63008EEC6E /* cmark.h */; };
24F833C51E62724C00590E90 /* node.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F141CFA5D63008EEC6E /* node.h */; };
24F833C71E62727400590E90 /* inlines.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F0C1CFA5D63008EEC6E /* inlines.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833C81E62727D00590E90 /* houdini_html_u.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F091CFA5D63008EEC6E /* houdini_html_u.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833C91E62728300590E90 /* blocks.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201EF71CFA5D63008EEC6E /* blocks.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833CA1E62728A00590E90 /* DownErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = D44875E81CFA6CF30037A624 /* DownErrors.swift */; };
24F833CB1E62729100590E90 /* DownASTRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D486E9951CFDD4860059FD7C /* DownASTRenderable.swift */; };
24F833CC1E62729800590E90 /* DownRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D44875E31CFA6B200037A624 /* DownRenderable.swift */; };
24F833CD1E62729E00590E90 /* node.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F131CFA5D63008EEC6E /* node.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833CE1E6272A400590E90 /* html.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F0A1CFA5D63008EEC6E /* html.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833CF1E6272A800590E90 /* latex.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F101CFA5D63008EEC6E /* latex.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833D01E6272B000590E90 /* scanners.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F1A1CFA5D63008EEC6E /* scanners.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833D21E6272BC00590E90 /* DownCommonMarkRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4DC91131CFDED4B0091CE09 /* DownCommonMarkRenderable.swift */; };
24F833D31E6272C200590E90 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F1C1CFA5D63008EEC6E /* utf8.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833D41E6272C500590E90 /* buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201EF81CFA5D63008EEC6E /* buffer.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833D51E6272CF00590E90 /* DownHTMLRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D44875E51CFA6B660037A624 /* DownHTMLRenderable.swift */; };
24F833D61E6272E900590E90 /* DownOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D44875E91CFA6CF30037A624 /* DownOptions.swift */; };
24F833D71E6272ED00590E90 /* DownGroffRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D486E9991CFDE28B0059FD7C /* DownGroffRenderable.swift */; };
24F833D81E6272F400590E90 /* xml.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F1E1CFA5D63008EEC6E /* xml.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833D91E6272F900590E90 /* houdini_href_e.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F071CFA5D63008EEC6E /* houdini_href_e.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833DA1E62730200590E90 /* Down.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4201EF01CFA59F2008EEC6E /* Down.swift */; };
24F833DB1E62730900590E90 /* NSAttributedString+HTML.swift in Sources */ = {isa = PBXBuildFile; fileRef = D43AE5C91CFFAE4D006E1522 /* NSAttributedString+HTML.swift */; };
24F833DC1E62731200590E90 /* commonmark.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F021CFA5D63008EEC6E /* commonmark.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833DD1E62731600590E90 /* DownLaTeXRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D486E9971CFDE2730059FD7C /* DownLaTeXRenderable.swift */; };
24F833DE1E62731F00590E90 /* render.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F181CFA5D63008EEC6E /* render.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833DF1E62732300590E90 /* houdini_html_e.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F081CFA5D63008EEC6E /* houdini_html_e.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833E01E62732D00590E90 /* String+ToHTML.swift in Sources */ = {isa = PBXBuildFile; fileRef = D43AE5DB1CFFD473006E1522 /* String+ToHTML.swift */; };
24F833E11E62733200590E90 /* references.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F161CFA5D63008EEC6E /* references.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833E21E62733C00590E90 /* DownAttributedStringRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4CF88971CFFAC2C00F07FD1 /* DownAttributedStringRenderable.swift */; };
24F833E31E62734000590E90 /* man.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F111CFA5D63008EEC6E /* man.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833E41E62734400590E90 /* iterator.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F0E1CFA5D63008EEC6E /* iterator.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833E51E62734C00590E90 /* DownXMLRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D486E9931CFDD33C0059FD7C /* DownXMLRenderable.swift */; };
24F833E61E62735000590E90 /* cmark_ctype.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201EFE1CFA5D63008EEC6E /* cmark_ctype.c */; settings = {COMPILER_FLAGS = "-w"; }; };
24F833E71E62735C00590E90 /* cmark.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201EFC1CFA5D63008EEC6E /* cmark.c */; settings = {COMPILER_FLAGS = "-w"; }; };
D41689B31CFFE28200E5802B /* DownViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D41689B21CFFE28200E5802B /* DownViewTests.swift */; };
D41689B61CFFE6BB00E5802B /* DownView.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D41689B51CFFE6BB00E5802B /* DownView.bundle */; };
D4201E8B1CFA5151008EEC6E /* Down.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4201E801CFA5151008EEC6E /* Down.framework */; };
@@ -49,6 +99,7 @@
D4201F431CFA5D63008EEC6E /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F1C1CFA5D63008EEC6E /* utf8.c */; settings = {COMPILER_FLAGS = "-w"; }; };
D4201F441CFA5D63008EEC6E /* utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = D4201F1D1CFA5D63008EEC6E /* utf8.h */; };
D4201F451CFA5D63008EEC6E /* xml.c in Sources */ = {isa = PBXBuildFile; fileRef = D4201F1E1CFA5D63008EEC6E /* xml.c */; settings = {COMPILER_FLAGS = "-w"; }; };
D438696C1D00D27700E95A1F /* StringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D438696B1D00D27700E95A1F /* StringTests.swift */; };
D43AE5CA1CFFAE4D006E1522 /* NSAttributedString+HTML.swift in Sources */ = {isa = PBXBuildFile; fileRef = D43AE5C91CFFAE4D006E1522 /* NSAttributedString+HTML.swift */; };
D43AE5DA1CFFD0D0006E1522 /* DownView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D43AE5D91CFFD0D0006E1522 /* DownView.swift */; };
D43AE5DC1CFFD473006E1522 /* String+ToHTML.swift in Sources */ = {isa = PBXBuildFile; fileRef = D43AE5DB1CFFD473006E1522 /* String+ToHTML.swift */; };
@@ -62,6 +113,7 @@
D486E99A1CFDE28B0059FD7C /* DownGroffRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D486E9991CFDE28B0059FD7C /* DownGroffRenderable.swift */; };
D4CF88981CFFAC2C00F07FD1 /* DownAttributedStringRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4CF88971CFFAC2C00F07FD1 /* DownAttributedStringRenderable.swift */; };
D4DC91141CFDED4B0091CE09 /* DownCommonMarkRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4DC91131CFDED4B0091CE09 /* DownCommonMarkRenderable.swift */; };
D4F948DC1D00A4A800C9C0F6 /* NSAttributedStringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4F948DB1D00A4A800C9C0F6 /* NSAttributedStringTests.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -75,6 +127,9 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
24F833AA1E62706000590E90 /* Down.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Down.framework; sourceTree = BUILT_PRODUCTS_DIR; };
24F833AC1E62706000590E90 /* Down.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Down.h; sourceTree = "<group>"; };
24F833AD1E62706000590E90 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D41689B21CFFE28200E5802B /* DownViewTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownViewTests.swift; sourceTree = "<group>"; };
D41689B51CFFE6BB00E5802B /* DownView.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = DownView.bundle; sourceTree = "<group>"; };
D4201E801CFA5151008EEC6E /* Down.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Down.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -120,6 +175,7 @@
D4201F1D1CFA5D63008EEC6E /* utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utf8.h; sourceTree = "<group>"; };
D4201F1E1CFA5D63008EEC6E /* xml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xml.c; sourceTree = "<group>"; };
D42869501CFF501200FACB4C /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
D438696B1D00D27700E95A1F /* StringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringTests.swift; sourceTree = "<group>"; };
D43AE5C91CFFAE4D006E1522 /* NSAttributedString+HTML.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSAttributedString+HTML.swift"; sourceTree = "<group>"; };
D43AE5D91CFFD0D0006E1522 /* DownView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownView.swift; sourceTree = "<group>"; };
D43AE5DB1CFFD473006E1522 /* String+ToHTML.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+ToHTML.swift"; sourceTree = "<group>"; };
@@ -134,9 +190,17 @@
D4CF88961CFF94B300F07FD1 /* Down.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Down.h; sourceTree = "<group>"; };
D4CF88971CFFAC2C00F07FD1 /* DownAttributedStringRenderable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownAttributedStringRenderable.swift; sourceTree = "<group>"; };
D4DC91131CFDED4B0091CE09 /* DownCommonMarkRenderable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownCommonMarkRenderable.swift; sourceTree = "<group>"; };
D4F948DB1D00A4A800C9C0F6 /* NSAttributedStringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSAttributedStringTests.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
24F833A61E62706000590E90 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
D4201E7C1CFA5151008EEC6E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -155,6 +219,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
24F833AB1E62706000590E90 /* Down */ = {
isa = PBXGroup;
children = (
24F833AC1E62706000590E90 /* Down.h */,
24F833AD1E62706000590E90 /* Info.plist */,
);
path = Down;
sourceTree = "<group>";
};
D41689B41CFFE6BB00E5802B /* Resources */ = {
isa = PBXGroup;
children = (
@@ -170,15 +243,19 @@
D4201E9B1CFA59A5008EEC6E /* Source */,
D41689B41CFFE6BB00E5802B /* Resources */,
D4201EC41CFA59A5008EEC6E /* Tests */,
24F833AB1E62706000590E90 /* Down */,
D4201E811CFA5151008EEC6E /* Products */,
);
indentWidth = 4;
sourceTree = "<group>";
tabWidth = 4;
};
D4201E811CFA5151008EEC6E /* Products */ = {
isa = PBXGroup;
children = (
D4201E801CFA5151008EEC6E /* Down.framework */,
D4201E8A1CFA5151008EEC6E /* DownTests.xctest */,
24F833AA1E62706000590E90 /* Down.framework */,
);
name = Products;
sourceTree = "<group>";
@@ -202,6 +279,8 @@
children = (
D4201EC51CFA59A5008EEC6E /* BindingTests.swift */,
D41689B21CFFE28200E5802B /* DownViewTests.swift */,
D4F948DB1D00A4A800C9C0F6 /* NSAttributedStringTests.swift */,
D438696B1D00D27700E95A1F /* StringTests.swift */,
);
path = Tests;
sourceTree = "<group>";
@@ -295,6 +374,31 @@
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
24F833A71E62706000590E90 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
24F833C51E62724C00590E90 /* node.h in Headers */,
24F833C41E62724600590E90 /* cmark.h in Headers */,
24F833C31E62723E00590E90 /* houdini.h in Headers */,
24F833C21E62723600590E90 /* iterator.h in Headers */,
24F833C11E62723000590E90 /* cmark_ctype.h in Headers */,
24F833C01E62722500590E90 /* html_unescape.h in Headers */,
24F833BF1E62721E00590E90 /* cmark_version.h in Headers */,
24F833BE1E62721700590E90 /* utf8.h in Headers */,
24F833BD1E62721100590E90 /* references.h in Headers */,
24F833BC1E62720A00590E90 /* chunk.h in Headers */,
24F833BB1E62720300590E90 /* debug.h in Headers */,
24F833BA1E6271FB00590E90 /* buffer.h in Headers */,
24F833B91E6271F400590E90 /* inlines.h in Headers */,
24F833B81E6271EE00590E90 /* parser.h in Headers */,
24F833B71E6271E700590E90 /* cmark_export.h in Headers */,
24F833B61E6271E000590E90 /* render.h in Headers */,
24F833B51E6271D900590E90 /* scanners.h in Headers */,
24F833B41E6271D200590E90 /* config.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D4201E7D1CFA5151008EEC6E /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
@@ -323,9 +427,27 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
D4201E7F1CFA5151008EEC6E /* Down */ = {
24F833A91E62706000590E90 /* Down-tvOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = D4201E941CFA5151008EEC6E /* Build configuration list for PBXNativeTarget "Down" */;
buildConfigurationList = 24F833AF1E62706000590E90 /* Build configuration list for PBXNativeTarget "Down-tvOS" */;
buildPhases = (
24F833A51E62706000590E90 /* Sources */,
24F833A61E62706000590E90 /* Frameworks */,
24F833A71E62706000590E90 /* Headers */,
24F833A81E62706000590E90 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "Down-tvOS";
productName = Down;
productReference = 24F833AA1E62706000590E90 /* Down.framework */;
productType = "com.apple.product-type.framework";
};
D4201E7F1CFA5151008EEC6E /* Down-iOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = D4201E941CFA5151008EEC6E /* Build configuration list for PBXNativeTarget "Down-iOS" */;
buildPhases = (
D4201E7B1CFA5151008EEC6E /* Sources */,
D4201E7C1CFA5151008EEC6E /* Frameworks */,
@@ -336,7 +458,7 @@
);
dependencies = (
);
name = Down;
name = "Down-iOS";
productName = Down;
productReference = D4201E801CFA5151008EEC6E /* Down.framework */;
productType = "com.apple.product-type.framework";
@@ -366,14 +488,21 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Glazed Donut, LLC.";
TargetAttributes = {
24F833A91E62706000590E90 = {
CreatedOnToolsVersion = 8.2.1;
ProvisioningStyle = Automatic;
};
D4201E7F1CFA5151008EEC6E = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0800;
ProvisioningStyle = Automatic;
};
D4201E891CFA5151008EEC6E = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0800;
};
};
};
@@ -389,13 +518,21 @@
projectDirPath = "";
projectRoot = "";
targets = (
D4201E7F1CFA5151008EEC6E /* Down */,
D4201E7F1CFA5151008EEC6E /* Down-iOS */,
24F833A91E62706000590E90 /* Down-tvOS */,
D4201E891CFA5151008EEC6E /* DownTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
24F833A81E62706000590E90 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
D4201E7E1CFA5151008EEC6E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -414,6 +551,45 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
24F833A51E62706000590E90 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
24F833E61E62735000590E90 /* cmark_ctype.c in Sources */,
24F833E51E62734C00590E90 /* DownXMLRenderable.swift in Sources */,
24F833E41E62734400590E90 /* iterator.c in Sources */,
24F833E31E62734000590E90 /* man.c in Sources */,
24F833E21E62733C00590E90 /* DownAttributedStringRenderable.swift in Sources */,
24F833E11E62733200590E90 /* references.c in Sources */,
24F833E01E62732D00590E90 /* String+ToHTML.swift in Sources */,
24F833DF1E62732300590E90 /* houdini_html_e.c in Sources */,
24F833DE1E62731F00590E90 /* render.c in Sources */,
24F833DD1E62731600590E90 /* DownLaTeXRenderable.swift in Sources */,
24F833DC1E62731200590E90 /* commonmark.c in Sources */,
24F833DB1E62730900590E90 /* NSAttributedString+HTML.swift in Sources */,
24F833DA1E62730200590E90 /* Down.swift in Sources */,
24F833D91E6272F900590E90 /* houdini_href_e.c in Sources */,
24F833D81E6272F400590E90 /* xml.c in Sources */,
24F833D71E6272ED00590E90 /* DownGroffRenderable.swift in Sources */,
24F833D61E6272E900590E90 /* DownOptions.swift in Sources */,
24F833D51E6272CF00590E90 /* DownHTMLRenderable.swift in Sources */,
24F833D41E6272C500590E90 /* buffer.c in Sources */,
24F833D31E6272C200590E90 /* utf8.c in Sources */,
24F833D21E6272BC00590E90 /* DownCommonMarkRenderable.swift in Sources */,
24F833D01E6272B000590E90 /* scanners.c in Sources */,
24F833CF1E6272A800590E90 /* latex.c in Sources */,
24F833CE1E6272A400590E90 /* html.c in Sources */,
24F833CD1E62729E00590E90 /* node.c in Sources */,
24F833CC1E62729800590E90 /* DownRenderable.swift in Sources */,
24F833CB1E62729100590E90 /* DownASTRenderable.swift in Sources */,
24F833CA1E62728A00590E90 /* DownErrors.swift in Sources */,
24F833E71E62735C00590E90 /* cmark.c in Sources */,
24F833C91E62728300590E90 /* blocks.c in Sources */,
24F833C81E62727D00590E90 /* houdini_html_u.c in Sources */,
24F833C71E62727400590E90 /* inlines.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D4201E7B1CFA5151008EEC6E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -460,6 +636,8 @@
files = (
D41689B31CFFE28200E5802B /* DownViewTests.swift in Sources */,
D4201EEF1CFA59AD008EEC6E /* BindingTests.swift in Sources */,
D438696C1D00D27700E95A1F /* StringTests.swift in Sources */,
D4F948DC1D00A4A800C9C0F6 /* NSAttributedStringTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -468,12 +646,52 @@
/* Begin PBXTargetDependency section */
D4201E8D1CFA5151008EEC6E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = D4201E7F1CFA5151008EEC6E /* Down */;
target = D4201E7F1CFA5151008EEC6E /* Down-iOS */;
targetProxy = D4201E8C1CFA5151008EEC6E /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
24F833B01E62706000590E90 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazeddonut.Down;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Source/cmark/**";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 3;
};
name = Debug;
};
24F833B11E62706000590E90 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazeddonut.Down;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Source/cmark/**";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 3;
};
name = Release;
};
D4201E921CFA5151008EEC6E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -489,8 +707,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -516,9 +736,11 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = Down;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@@ -539,8 +761,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -559,8 +783,11 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = Down;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@@ -570,41 +797,38 @@
D4201E951CFA5151008EEC6E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazeddonut.Down;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Source/cmark/**";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
D4201E961CFA5151008EEC6E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazeddonut.Down;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Source/cmark/**";
SWIFT_VERSION = 3.0;
};
name = Release;
};
@@ -612,9 +836,11 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
DEVELOPMENT_TEAM = "";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazeddonut.DownTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
@@ -622,15 +848,25 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
DEVELOPMENT_TEAM = "";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazeddonut.DownTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
24F833AF1E62706000590E90 /* Build configuration list for PBXNativeTarget "Down-tvOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
24F833B01E62706000590E90 /* Debug */,
24F833B11E62706000590E90 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
D4201E7A1CFA5151008EEC6E /* Build configuration list for PBXProject "Down" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -640,7 +876,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D4201E941CFA5151008EEC6E /* Build configuration list for PBXNativeTarget "Down" */ = {
D4201E941CFA5151008EEC6E /* Build configuration list for PBXNativeTarget "Down-iOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D4201E951CFA5151008EEC6E /* Debug */,
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -15,8 +15,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D4201E7F1CFA5151008EEC6E"
BuildableName = "Down.framework"
BlueprintName = "Down"
BuildableName = "Down-iOS.framework"
BlueprintName = "Down-iOS"
ReferencedContainer = "container:Down.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@@ -43,8 +43,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D4201E7F1CFA5151008EEC6E"
BuildableName = "Down.framework"
BlueprintName = "Down"
BuildableName = "Down-iOS.framework"
BlueprintName = "Down-iOS"
ReferencedContainer = "container:Down.xcodeproj">
</BuildableReference>
</MacroExpansion>
@@ -65,8 +65,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D4201E7F1CFA5151008EEC6E"
BuildableName = "Down.framework"
BlueprintName = "Down"
BuildableName = "Down-iOS.framework"
BlueprintName = "Down-iOS"
ReferencedContainer = "container:Down.xcodeproj">
</BuildableReference>
</MacroExpansion>
@@ -83,8 +83,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D4201E7F1CFA5151008EEC6E"
BuildableName = "Down.framework"
BlueprintName = "Down"
BuildableName = "Down-iOS.framework"
BlueprintName = "Down-iOS"
ReferencedContainer = "container:Down.xcodeproj">
</BuildableReference>
</MacroExpansion>
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "24F833A91E62706000590E90"
BuildableName = "Down-tvOS.framework"
BlueprintName = "Down-tvOS"
ReferencedContainer = "container:Down.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "24F833A91E62706000590E90"
BuildableName = "Down-tvOS.framework"
BlueprintName = "Down-tvOS"
ReferencedContainer = "container:Down.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "24F833A91E62706000590E90"
BuildableName = "Down-tvOS.framework"
BlueprintName = "Down-tvOS"
ReferencedContainer = "container:Down.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+25 -3
View File
@@ -1,9 +1,11 @@
## Down
[![Coverage Status](https://coveralls.io/repos/github/iwasrobbed/Down/badge.svg?branch=master)](https://coveralls.io/github/iwasrobbed/Down?branch=master)
[![Build Status](https://travis-ci.org/iwasrobbed/Down.svg?branch=master)](https://travis-ci.org/iwasrobbed/Down)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/iwasrobbed/Down/blob/master/LICENSE)
[![CocoaPods](https://img.shields.io/cocoapods/v/Down.svg?maxAge=2592000)]()
[![Swift](https://img.shields.io/badge/language-Swift-blue.svg)](https://swift.org)
[![iOS](https://img.shields.io/badge/OS-iOS-blue.svg)](https://developer.apple.com/ios/)
[![tvOS](https://img.shields.io/badge/OS-tvOS-blue.svg)](https://developer.apple.com/tvos/)
[![Coverage Status](https://coveralls.io/repos/github/iwasrobbed/Down/badge.svg?branch=master)](https://coveralls.io/github/iwasrobbed/Down?branch=master)
Blazing fast Markdown rendering in Swift, built upon [cmark](https://github.com/jgm/cmark).
@@ -17,6 +19,20 @@ Quickly install using [CocoaPods](https://cocoapods.org):
pod 'Down'
```
Or [Carthage](https://github.com/Carthage/Carthage):
```
github "iwasrobbed/Down"
```
Or manually install:
1. Clone this repository
2. Build the Down project
3. Add the resulting framework file to your project
4. ?
5. Profit
### Robust Performance
>[cmark](https://github.com/jgm/cmark) can render a Markdown version of War and Peace in the blink of an eye (127 milliseconds on a ten year old laptop, vs. 100-400 milliseconds for an eye blink). In our [benchmarks](https://github.com/jgm/cmark/blob/master/benchmarks.md), cmark is 10,000 times faster than the original Markdown.pl, and on par with the very fastest available Markdown processors.
@@ -38,8 +54,14 @@ pod 'Down'
The `DownView` class offers a very simple way to parse a UTF-8 encoded string with Markdown and convert it to a web view that can be added to any view:
```swift
let downView = try? DownView(frame: self.view.bounds, markdownString: "**Oh Hai**")
let downView = try? DownView(frame: self.view.bounds, markdownString: "**Oh Hai**") {
// Optional callback for loading finished
}
// Now add to view or constrain w/ Autolayout
// Or you could optionally update the contents at some point:
try? downView?.update(markdownString: "## [Google](https://google.com)") {
// Optional callback for loading finished
}
```
Meta example of rendering this README:
@@ -181,4 +203,4 @@ Please feel free to fork and create a pull request for bug fixes or improvements
### Credit
This library is a wrapper around [cmark](https://github.com/jgm/cmark), which is built upon the [CommonMark](http://commonmark.org) Markdown specification.
[cmark](https://github.com/jgm/cmark) is Copyright (c) 2014, John MacFarlane. View [full license](https://github.com/jgm/cmark/blob/master/COPYING).
[cmark](https://github.com/jgm/cmark) is Copyright (c) 2014, John MacFarlane. View [full license](https://github.com/jgm/cmark/blob/master/COPYING).
+2 -2
View File
@@ -23,8 +23,8 @@ public struct Down: DownASTRenderable, DownHTMLRenderable, DownXMLRenderable,
- returns: An instance of Self
*/
@warn_unused_result
public init(markdownString: String) {
self.markdownString = markdownString
}
}
}
+5 -5
View File
@@ -8,19 +8,19 @@
import Foundation
public enum DownErrors: ErrorType {
public enum DownErrors: Error {
/**
Thrown when there was an issue converting the Markdown into an abstract syntax tree
*/
case MarkdownToASTError
case markdownToASTError
/**
Thrown when the abstract syntax tree could not be rendered into another format
*/
case ASTRenderingError
case astRenderingError
/**
Thrown when an HTML string cannot be converted into an `NSData` representation
*/
case HTMLDataConversionError
}
case htmlDataConversionError
}
+9 -8
View File
@@ -7,27 +7,28 @@
//
import Foundation
import libcmark
public struct DownOptions: OptionSetType {
public struct DownOptions: OptionSet {
public let rawValue: Int32
public init(rawValue: Int32) { self.rawValue = rawValue }
/**
Default options
*/
public static let Default = DownOptions(rawValue: 0)
public static let Default = DownOptions(rawValue: CMARK_OPT_DEFAULT)
// MARK: - Rendering Options
/**
Include a `data-sourcepos` attribute on all block elements
*/
public static let SourcePos = DownOptions(rawValue: 1 << 1)
public static let SourcePos = DownOptions(rawValue: CMARK_OPT_SOURCEPOS)
/**
Render `softbreak` elements as hard line breaks.
*/
public static let HardBreaks = DownOptions(rawValue: 1 << 2)
public static let HardBreaks = DownOptions(rawValue: CMARK_OPT_HARDBREAKS)
/**
Suppress raw HTML and unsafe links (`javascript:`, `vbscript:`,
@@ -36,24 +37,24 @@ public struct DownOptions: OptionSetType {
by a placeholder HTML comment. Unsafe links are replaced by
empty strings.
*/
public static let Safe = DownOptions(rawValue: 1 << 3)
public static let Safe = DownOptions(rawValue: CMARK_OPT_SAFE)
// MARK: - Parsing Options
/**
Normalize tree by consolidating adjacent text nodes.
*/
public static let Normalize = DownOptions(rawValue: 1 << 4)
public static let Normalize = DownOptions(rawValue: CMARK_OPT_NORMALIZE)
/**
Validate UTF-8 in the input before parsing, replacing illegal
sequences with the replacement character U+FFFD.
*/
public static let ValidateUTF8 = DownOptions(rawValue: 1 << 5)
public static let ValidateUTF8 = DownOptions(rawValue: CMARK_OPT_VALIDATE_UTF8)
/**
Convert straight quotes to curly, --- to em dashes, -- to en dashes.
*/
public static let Smart = DownOptions(rawValue: 1 << 6)
public static let Smart = DownOptions(rawValue: CMARK_OPT_SMART)
}
@@ -20,13 +20,16 @@ extension NSAttributedString {
- returns: An attributed string
*/
convenience init(htmlString: String) throws {
guard let data = htmlString.dataUsingEncoding(NSUTF8StringEncoding) else {
throw DownErrors.HTMLDataConversionError
guard let data = htmlString.data(using: String.Encoding.utf8) else {
throw DownErrors.htmlDataConversionError
}
let options = [NSDocumentTypeDocumentAttribute : NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute: NSNumber(unsignedInteger:NSUTF8StringEncoding)]
let options: [String: Any] = [
NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute: NSNumber(value: String.Encoding.utf8.rawValue)
]
try self.init(data: data, options: options, documentAttributes: nil)
}
}
}
+1 -1
View File
@@ -20,7 +20,7 @@ extension String {
- returns: HTML string
*/
public func toHTML(options: DownOptions = .Default) throws -> String {
public func toHTML(_ options: DownOptions = .Default) throws -> String {
let ast = try DownASTRenderer.stringToAST(self, options: options)
let html = try DownHTMLRenderer.astToHTML(ast, options: options)
cmark_node_free(ast)
+8 -8
View File
@@ -19,8 +19,8 @@ public protocol DownASTRenderable: DownRenderable {
- returns: An abstract syntax tree representation of the Markdown input
*/
@warn_unused_result
func toAST(options: DownOptions) throws -> UnsafeMutablePointer<cmark_node>
func toAST(_ options: DownOptions) throws -> UnsafeMutablePointer<cmark_node>
}
public extension DownASTRenderable {
@@ -33,8 +33,8 @@ public extension DownASTRenderable {
- returns: An abstract syntax tree representation of the Markdown input
*/
@warn_unused_result
public func toAST(options: DownOptions = .Default) throws -> UnsafeMutablePointer<cmark_node> {
public func toAST(_ options: DownOptions = .Default) throws -> UnsafeMutablePointer<cmark_node> {
return try DownASTRenderer.stringToAST(markdownString, options: options)
}
}
@@ -51,8 +51,8 @@ public struct DownASTRenderer {
- returns: An abstract syntax tree representation of the Markdown input
*/
@warn_unused_result
public static func stringToAST(string: String, options: DownOptions = .Default) throws -> UnsafeMutablePointer<cmark_node> {
public static func stringToAST(_ string: String, options: DownOptions = .Default) throws -> UnsafeMutablePointer<cmark_node> {
var tree: UnsafeMutablePointer<cmark_node>?
string.withCString {
let stringLength = Int(strlen($0))
@@ -60,8 +60,8 @@ public struct DownASTRenderer {
}
guard let ast = tree else {
throw DownErrors.MarkdownToASTError
throw DownErrors.markdownToASTError
}
return ast
}
}
}
@@ -19,8 +19,8 @@ public protocol DownAttributedStringRenderable: DownHTMLRenderable {
- returns: An `NSAttributedString`
*/
@warn_unused_result
func toAttributedString(options: DownOptions) throws -> NSAttributedString
func toAttributedString(_ options: DownOptions) throws -> NSAttributedString
}
public extension DownAttributedStringRenderable {
@@ -33,9 +33,9 @@ public extension DownAttributedStringRenderable {
- returns: An `NSAttributedString`
*/
@warn_unused_result
public func toAttributedString(options: DownOptions = .Default) throws -> NSAttributedString {
public func toAttributedString(_ options: DownOptions = .Default) throws -> NSAttributedString {
let html = try self.toHTML(options)
return try NSAttributedString(htmlString: html)
}
}
}
+15 -14
View File
@@ -20,8 +20,8 @@ public protocol DownCommonMarkRenderable: DownRenderable {
- returns: CommonMark Markdown string
*/
@warn_unused_result
func toCommonMark(options: DownOptions, width: Int32) throws -> String
func toCommonMark(_ options: DownOptions, width: Int32) throws -> String
}
public extension DownCommonMarkRenderable {
@@ -35,8 +35,8 @@ public extension DownCommonMarkRenderable {
- returns: CommonMark Markdown string
*/
@warn_unused_result
public func toCommonMark(options: DownOptions = .Default, width: Int32 = 0) throws -> String {
public func toCommonMark(_ options: DownOptions = .Default, width: Int32 = 0) throws -> String {
let ast = try DownASTRenderer.stringToAST(markdownString, options: options)
let commonMark = try DownCommonMarkRenderer.astToCommonMark(ast, options: options, width: width)
cmark_node_free(ast)
@@ -57,18 +57,19 @@ public struct DownCommonMarkRenderer {
- returns: CommonMark Markdown string
*/
@warn_unused_result
public static func astToCommonMark(ast: UnsafeMutablePointer<cmark_node>,
public static func astToCommonMark(_ ast: UnsafeMutablePointer<cmark_node>,
options: DownOptions = .Default,
width: Int32 = 0) throws -> String {
let cCommonMarkString = cmark_render_commonmark(ast, options.rawValue, width)
let outputString = String(CString: cCommonMarkString, encoding: NSUTF8StringEncoding)
free(cCommonMarkString)
guard let commonMarkString = outputString else {
throw DownErrors.ASTRenderingError
guard let cCommonMarkString = cmark_render_commonmark(ast, options.rawValue, width) else {
throw DownErrors.astRenderingError
}
defer { free(cCommonMarkString) }
guard let commonMarkString = String(cString: cCommonMarkString, encoding: String.Encoding.utf8) else {
throw DownErrors.astRenderingError
}
return commonMarkString
}
}
}
+15 -14
View File
@@ -20,8 +20,8 @@ public protocol DownGroffRenderable: DownRenderable {
- returns: groff man string
*/
@warn_unused_result
func toGroff(options: DownOptions, width: Int32) throws -> String
func toGroff(_ options: DownOptions, width: Int32) throws -> String
}
public extension DownGroffRenderable {
@@ -35,8 +35,8 @@ public extension DownGroffRenderable {
- returns: groff man string
*/
@warn_unused_result
public func toGroff(options: DownOptions = .Default, width: Int32 = 0) throws -> String {
public func toGroff(_ options: DownOptions = .Default, width: Int32 = 0) throws -> String {
let ast = try DownASTRenderer.stringToAST(markdownString, options: options)
let groff = try DownGroffRenderer.astToGroff(ast, options: options, width: width)
cmark_node_free(ast)
@@ -57,18 +57,19 @@ public struct DownGroffRenderer {
- returns: groff man string
*/
@warn_unused_result
public static func astToGroff(ast: UnsafeMutablePointer<cmark_node>,
public static func astToGroff(_ ast: UnsafeMutablePointer<cmark_node>,
options: DownOptions = .Default,
width: Int32 = 0) throws -> String {
let cGroffString = cmark_render_man(ast, options.rawValue, width)
let outputString = String(CString: cGroffString, encoding: NSUTF8StringEncoding)
free(cGroffString)
guard let groffString = outputString else {
throw DownErrors.ASTRenderingError
guard let cGroffString = cmark_render_man(ast, options.rawValue, width) else {
throw DownErrors.astRenderingError
}
defer { free(cGroffString) }
guard let groffString = String(cString: cGroffString, encoding: String.Encoding.utf8) else {
throw DownErrors.astRenderingError
}
return groffString
}
}
}
+15 -14
View File
@@ -19,8 +19,8 @@ public protocol DownHTMLRenderable: DownRenderable {
- returns: HTML string
*/
@warn_unused_result
func toHTML(options: DownOptions) throws -> String
func toHTML(_ options: DownOptions) throws -> String
}
public extension DownHTMLRenderable {
@@ -33,8 +33,8 @@ public extension DownHTMLRenderable {
- returns: HTML string
*/
@warn_unused_result
public func toHTML(options: DownOptions = .Default) throws -> String {
public func toHTML(_ options: DownOptions = .Default) throws -> String {
return try markdownString.toHTML(options)
}
}
@@ -51,16 +51,17 @@ public struct DownHTMLRenderer {
- returns: HTML string
*/
@warn_unused_result
public static func astToHTML(ast: UnsafeMutablePointer<cmark_node>, options: DownOptions = .Default) throws -> String {
let cHTMLString = cmark_render_html(ast, options.rawValue)
let outputString = String(CString: cHTMLString, encoding: NSUTF8StringEncoding)
free(cHTMLString)
guard let htmlString = outputString else {
throw DownErrors.ASTRenderingError
public static func astToHTML(_ ast: UnsafeMutablePointer<cmark_node>, options: DownOptions = .Default) throws -> String {
guard let cHTMLString = cmark_render_html(ast, options.rawValue) else {
throw DownErrors.astRenderingError
}
defer { free(cHTMLString) }
guard let htmlString = String(cString: cHTMLString, encoding: String.Encoding.utf8) else {
throw DownErrors.astRenderingError
}
return htmlString
}
}
}
+15 -14
View File
@@ -20,8 +20,8 @@ public protocol DownLaTeXRenderable: DownRenderable {
- returns: LaTeX string
*/
@warn_unused_result
func toLaTeX(options: DownOptions, width: Int32) throws -> String
func toLaTeX(_ options: DownOptions, width: Int32) throws -> String
}
public extension DownLaTeXRenderable {
@@ -35,8 +35,8 @@ public extension DownLaTeXRenderable {
- returns: LaTeX string
*/
@warn_unused_result
public func toLaTeX(options: DownOptions = .Default, width: Int32 = 0) throws -> String {
public func toLaTeX(_ options: DownOptions = .Default, width: Int32 = 0) throws -> String {
let ast = try DownASTRenderer.stringToAST(markdownString, options: options)
let latex = try DownLaTeXRenderer.astToLaTeX(ast, options: options, width: width)
cmark_node_free(ast)
@@ -57,18 +57,19 @@ public struct DownLaTeXRenderer {
- returns: LaTeX string
*/
@warn_unused_result
public static func astToLaTeX(ast: UnsafeMutablePointer<cmark_node>,
public static func astToLaTeX(_ ast: UnsafeMutablePointer<cmark_node>,
options: DownOptions = .Default,
width: Int32 = 0) throws -> String {
let cLatexString = cmark_render_latex(ast, options.rawValue, width)
let outputString = String(CString: cLatexString, encoding: NSUTF8StringEncoding)
free(cLatexString)
guard let latexString = outputString else {
throw DownErrors.ASTRenderingError
guard let cLatexString = cmark_render_latex(ast, options.rawValue, width) else {
throw DownErrors.astRenderingError
}
defer { free(cLatexString) }
guard let latexString = String(cString: cLatexString, encoding: String.Encoding.utf8) else {
throw DownErrors.astRenderingError
}
return latexString
}
}
}
+15 -14
View File
@@ -19,8 +19,8 @@ public protocol DownXMLRenderable: DownRenderable {
- returns: XML string
*/
@warn_unused_result
func toXML(options: DownOptions) throws -> String
func toXML(_ options: DownOptions) throws -> String
}
public extension DownXMLRenderable {
@@ -33,8 +33,8 @@ public extension DownXMLRenderable {
- returns: XML string
*/
@warn_unused_result
public func toXML(options: DownOptions = .Default) throws -> String {
public func toXML(_ options: DownOptions = .Default) throws -> String {
let ast = try DownASTRenderer.stringToAST(markdownString, options: options)
let xml = try DownXMLRenderer.astToXML(ast, options: options)
cmark_node_free(ast)
@@ -54,16 +54,17 @@ public struct DownXMLRenderer {
- returns: XML string
*/
@warn_unused_result
public static func astToXML(ast: UnsafeMutablePointer<cmark_node>, options: DownOptions = .Default) throws -> String {
let cXMLString = cmark_render_xml(ast, options.rawValue)
let outputString = String(CString: cXMLString, encoding: NSUTF8StringEncoding)
free(cXMLString)
guard let xmlString = outputString else {
throw DownErrors.ASTRenderingError
public static func astToXML(_ ast: UnsafeMutablePointer<cmark_node>, options: DownOptions = .Default) throws -> String {
guard let cXMLString = cmark_render_xml(ast, options.rawValue) else {
throw DownErrors.astRenderingError
}
defer { free(cXMLString) }
guard let xmlString = String(cString: cXMLString, encoding: String.Encoding.utf8) else {
throw DownErrors.astRenderingError
}
return xmlString
}
}
}
+57 -24
View File
@@ -10,51 +10,80 @@ import WebKit
// MARK: - Public API
public class DownView: WKWebView {
public typealias DownViewClosure = () -> ()
open class DownView: WKWebView {
/**
Initializes a web view with the results of rendering a CommonMark Markdown string
- parameter frame: The frame size of the web view
- parameter markdownString: A string containing CommonMark Markdown
- parameter openLinksInBrowser: Whether or not to open links using an external browser
- parameter frame: The frame size of the web view
- parameter markdownString: A string containing CommonMark Markdown
- parameter openLinksInBrowser: Whether or not to open links using an external browser
- parameter didLoadSuccessfully: Optional callback for when the web content has loaded successfully
- returns: An instance of Self
*/
@warn_unused_result
public init(frame: CGRect, markdownString: String, openLinksInBrowser: Bool = true) throws {
public init(frame: CGRect, markdownString: String, openLinksInBrowser: Bool = true, didLoadSuccessfully: DownViewClosure? = nil) throws {
self.didLoadSuccessfully = didLoadSuccessfully
super.init(frame: frame, configuration: WKWebViewConfiguration())
if openLinksInBrowser { navigationDelegate = self }
if openLinksInBrowser || didLoadSuccessfully != nil { navigationDelegate = self }
try loadHTMLView(markdownString)
}
required public init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: - API
/**
Renders the given CommonMark Markdown string into HTML and updates the DownView while keeping the style intact
- parameter markdownString: A string containing CommonMark Markdown
- parameter didLoadSuccessfully: Optional callback for when the web content has loaded successfully
- throws: `DownErrors` depending on the scenario
*/
public func update(markdownString: String, didLoadSuccessfully: DownViewClosure? = nil) throws {
// Note: As the init method takes this callback already, we only overwrite it here if
// a non-nil value is passed in
if let didLoadSuccessfully = didLoadSuccessfully {
self.didLoadSuccessfully = didLoadSuccessfully
}
try loadHTMLView(markdownString)
}
// MARK: - Private Properties
private let bundle: NSBundle = {
let bundle = NSBundle(forClass: DownView.self)
let url = bundle.URLForResource("DownView", withExtension: "bundle")!
return NSBundle(URL: url)!
fileprivate let bundle: Bundle = {
let bundle = Bundle(for: DownView.self)
let url = bundle.url(forResource: "DownView", withExtension: "bundle")!
return Bundle(url: url)!
}()
private lazy var baseURL: NSURL = {
return self.bundle.URLForResource("index", withExtension: "html")!
fileprivate lazy var baseURL: URL = {
return self.bundle.url(forResource: "index", withExtension: "html")!
}()
fileprivate var didLoadSuccessfully: DownViewClosure?
}
// MARK: - Private API
private extension DownView {
func loadHTMLView(markdownString: String) throws {
func loadHTMLView(_ markdownString: String) throws {
let htmlString = try markdownString.toHTML()
let pageHTMLString = try htmlFromTemplate(htmlString)
loadHTMLString(pageHTMLString, baseURL: baseURL)
}
func htmlFromTemplate(htmlString: String) throws -> String {
let template = try NSString(contentsOfURL: baseURL, encoding: NSUTF8StringEncoding)
return template.stringByReplacingOccurrencesOfString("DOWN_HTML", withString: htmlString)
func htmlFromTemplate(_ htmlString: String) throws -> String {
let template = try NSString(contentsOf: baseURL, encoding: String.Encoding.utf8.rawValue)
return template.replacingOccurrences(of: "DOWN_HTML", with: htmlString)
}
}
@@ -63,16 +92,20 @@ private extension DownView {
extension DownView: WKNavigationDelegate {
public func webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void) {
guard let url = navigationAction.request.URL else { return }
public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
guard let url = navigationAction.request.url else { return }
switch navigationAction.navigationType {
case .LinkActivated:
decisionHandler(.Cancel)
UIApplication.sharedApplication().openURL(url)
case .linkActivated:
decisionHandler(.cancel)
UIApplication.shared.openURL(url)
default:
decisionHandler(.Allow)
decisionHandler(.allow)
}
}
}
public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
didLoadSuccessfully?()
}
}
-6
View File
@@ -47,11 +47,5 @@ class BindingTests: XCTestCase {
XCTAssertNotNil(commonMark)
XCTAssertTrue(commonMark == "## [Down](https://github.com/iwasrobbed/Down)\n")
}
func testAttributedStringBindingsWork() {
let attributedString = try? down.toAttributedString()
XCTAssertNotNil(attributedString)
XCTAssertTrue(attributedString!.string == "Down\n")
}
}
+62 -4
View File
@@ -12,9 +12,67 @@ import XCTest
class DownViewTests: XCTestCase {
func testInstantiation() {
let string = "## [Down](https://github.com/iwasrobbed/Down)"
let downView = try? DownView(frame: CGRectZero, markdownString: string)
XCTAssertNotNil(downView)
let expect1 = expectation(description: "DownView sets the html and validates the html is correct")
var downView: DownView?
downView = try? DownView(frame: .zero, markdownString: "## [Down](https://github.com/iwasrobbed/Down)", didLoadSuccessfully: {
self._pageContents(for: downView!) { (htmlString) in
XCTAssertTrue(htmlString!.contains("css/down.min.css"))
XCTAssertTrue(htmlString!.contains("https://github.com/iwasrobbed/Down"))
expect1.fulfill()
}
})
waitForExpectations(timeout: 10) { (error: Error?) in
if let error = error {
XCTFail("waitForExpectationsWithTimeout errored: \(error)")
}
}
}
func testUpdatingMarkdown() {
let expect1 = expectation(description: "DownView sets the html and validates the html is correct")
var downView: DownView?
downView = try? DownView(frame: .zero, markdownString: "## [Down](https://github.com/iwasrobbed/Down)") {
self._pageContents(for: downView!) { (htmlString) in
XCTAssertTrue(htmlString!.contains("css/down.min.css"))
XCTAssertTrue(htmlString!.contains("https://github.com/iwasrobbed/Down"))
expect1.fulfill()
}
}
waitForExpectations(timeout: 10) { (error: Error?) in
if let error = error {
XCTFail("waitForExpectationsWithTimeout errored: \(error)")
}
}
let expect2 = expectation(description: "DownView sets the html and validates the html is correct")
try? downView?.update(markdownString: "## [Google](https://google.com)") {
self._pageContents(for: downView!) { (htmlString) in
XCTAssertTrue(htmlString!.contains("css/down.min.css"))
XCTAssertTrue(htmlString!.contains("https://google.com"))
expect2.fulfill()
}
}
waitForExpectations(timeout: 10) { (error: Error?) in
if let error = error {
XCTFail("waitForExpectationsWithTimeout errored: \(error)")
}
}
}
}
}
fileprivate extension DownViewTests {
func _pageContents(for downView: DownView, completion: @escaping (_ htmlString: String?) -> ()) {
downView.evaluateJavaScript("document.documentElement.outerHTML.toString()") { (html: Any?, _) in
completion(html as? String)
}
}
}
+26
View File
@@ -0,0 +1,26 @@
//
// NSAttributedStringTests.swift
// Down
//
// Created by Rob Phillips on 6/2/16.
// Copyright © 2016 Glazed Donut, LLC. All rights reserved.
//
import XCTest
@testable import Down
class NSAttributedStringTests: XCTestCase {
func testAttributedStringBindingsWork() {
let attributedString = try? Down(markdownString: "## [Down](https://github.com/iwasrobbed/Down)").toAttributedString()
XCTAssertNotNil(attributedString)
XCTAssertTrue(attributedString!.string == "Down\n")
}
func testInstantiation() {
let attributedString = try? NSAttributedString(htmlString: "<html><body><p>Oh Hai</p></body></html>")
XCTAssertNotNil(attributedString)
XCTAssertTrue(attributedString!.string == "Oh Hai\n")
}
}
+22
View File
@@ -0,0 +1,22 @@
//
// StringTests.swift
// Down
//
// Created by Rob Phillips on 6/2/16.
// Copyright © 2016 Glazed Donut, LLC. All rights reserved.
//
import XCTest
@testable import Down
class StringTests: XCTestCase {
func testStringToHTML() {
// String is assumed to contain valid Markdown
let string = "## [Down](https://github.com/iwasrobbed/Down)"
let down = try? string.toHTML()
XCTAssertNotNil(down)
XCTAssertTrue(down == "<h2><a href=\"https://github.com/iwasrobbed/Down\">Down</a></h2>\n")
}
}