Giter Club home page Giter Club logo

markdown's People

Contributors

dileping avatar epaga avatar ypopovych avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

markdown's Issues

The package Discount has no Package.swift error

Hi,
I tried the installation using the swift package manager, but it throws an error saying:

Empty manifest file is not supported anymore. Use `swift package init` to autogenerate.
error: The package at `....../Packages/CDiscount.git' has no Package.swift for the specific version: 0.1.0

What can I do to actually install this library?

Thanks

"Module file was created by an older version" Error

Hi,

I'm installing the library using Carthage, but after following all the steps and doing the import, Xcode says:

Module file was created by an older version of the compiler; rebuild 'Markdown' and try again: /Volumes/MacOSHibrido/Users/nestor/Documents/freelances/ios-10-course/TestAppLayout/Carthage/Build/Mac/Markdown.framework/Modules/Markdown.swiftmodule/x86_64.swiftmodule

I tried running:
carthage update --no-use-binaries

But then I got the following error:

*** Fetching Markdown
*** Fetching CDiscount
*** Checking out CDiscount at "0.1.0"
*** Checking out Markdown at "0.1.0"
*** xcodebuild output can be found in /var/folders/5p/16f9d01140n53_65ftsbjh4h0000gn/T/carthage-xcodebuild.R8yKD7.log
*** Building scheme "Markdown" in Markdown.xcodeproj
** CLEAN FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
** BUILD FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
warning: no umbrella header found for target 'Markdown', module map will not be generated
warning: no umbrella header found for target 'Markdown', module map will not be generated
A shell task (/usr/bin/xcrun xcodebuild -project /Volumes/MacOSHibrido/Users/nestor/Documents/freelances/ios-10-course/TestAppLayout/Carthage/Checkouts/Markdown/Markdown.xcodeproj -scheme Markdown -configuration Release ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
** CLEAN FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
** BUILD FAILED **


The following build commands failed:
    Check dependencies
(1 failure)

How do I fix this?

Memory leak

There's a memory leak in Markdown.swift at line 47:

var dest = [UnsafeMutablePointer<Int8>?](repeating: UnsafeMutablePointer<Int8>.allocate(capacity: 1), count: 1)

This line is allocating space for a pointer to be returned, but in doing so is also allocating an actual pointer to one byte of memory. When fun is called to process data and return a result, the allocated pointer is overwritten and the one-byte allocation (16 actual bytes) is lost.

Since all you need is space for a pointer here, and since the array is an array-of-optionals, you can just replace that line with this:

var dest: [UnsafeMutablePointer<Int8>?] = [nil]

No allocation, so no leak.

text is cut before the end

I use the library to display a "terms and conditions" text.
The generated document is cut before the end of the source text.

the debug process:

let contents = try NSString(contentsOfFile: filepath, usedEncoding: nil) as String gives:

[...]se réserve la faculté de modifier à tout moment, de plein droit et sans formalités, les présentes CGU[...]

let md = try Markdown(string:contents)
let document = try md.document()

gives :

se réserve la faculté de modifier à tout moment, de plein droi

"

'libmarkdown' error `'mkdio.h' file not found` when using the Markdown library after installing Discount via brew

Hello!

After running brew install discount I can see that discount did properly install. However, Swift can't compile my app without using the following command:

swift build -Xcc -I/usr/local/include -Xlinker -L/usr/local/lib -Xswiftc -target -Xswiftc x86_64-apple-macosx10.12

I'm really new to this type of development and unfamiliar with the environment, so I am hoping this is not a real issue and is just some dummy error on my part.

This seems to be related to #3, which should have been resolved via a release for libmarkdown. Is there a status update on that?

Do you mind providing some insight on the issue?

PS. I'm following the Server-Side Swift book by @twostraws and it's been excellent. I've reached a project in the book that uses your library and that's when I found this issue.

System info

macOS 10.12.5
Xcode8.3.3

swift build output

➜  Project11 swift build
note: you may be able to install libmarkdown using your system-packager:

    brew install discount

note: you may be able to install libmarkdown using your system-packager:

    brew install discount

note: you may be able to install libmarkdown using your system-packager:

    brew install discount

Compile Swift Module 'libc' (1 sources)
Compile Swift Module 'Polymorphic' (2 sources)
Compile Swift Module 'Jay' (21 sources)
Compile Swift Module 'PathIndexable' (2 sources)
Compile Swift Module 'SwiftSlug' (1 sources)
Compile Swift Module 'Markdown' (3 sources)
Compile Swift Module 'Spectre' (8 sources)
Compile Swift Module 'Cryptor' (10 sources)
Compile Swift Module 'KituraTemplateEngine' (1 sources)
Compile Swift Module 'SwiftyJSON' (2 sources)
Compile Swift Module 'Socket' (3 sources)
Compile Swift Module 'LoggerAPI' (1 sources)
Compile Swift Module 'Core' (29 sources)
Compile Swift Module 'HeliumLogger' (2 sources)
Compile Swift Module 'Node' (22 sources)
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cdiscount.h"
        ^
/Users/zk/Developer/Server/Project11/.build/checkouts/CDiscount.git-4318135343521947030/cdiscount.h:22:10: error: 'mkdio.h' file not found
#include <mkdio.h>
         ^
/Users/zk/Developer/Server/Project11/.build/checkouts/Markdown.git--5008474681835546292/Sources/Markdown/Markdown.swift:22:8: error: could not build Objective-C module 'CDiscount'
import CDiscount
       ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cdiscount.h"
        ^
/Users/zk/Developer/Server/Project11/.build/checkouts/CDiscount.git-4318135343521947030/cdiscount.h:22:10: error: 'mkdio.h' file not found
#include <mkdio.h>
         ^
/Users/zk/Developer/Server/Project11/.build/checkouts/Markdown.git--5008474681835546292/Sources/Markdown/Markdown.swift:22:8: error: could not build Objective-C module 'CDiscount'
import CDiscount
       ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cdiscount.h"
        ^
/Users/zk/Developer/Server/Project11/.build/checkouts/CDiscount.git-4318135343521947030/cdiscount.h:22:10: error: 'mkdio.h' file not found
#include <mkdio.h>
         ^
/Users/zk/Developer/Server/Project11/.build/checkouts/Markdown.git--5008474681835546292/Sources/Markdown/Markdown.swift:22:8: error: could not build Objective-C module 'CDiscount'
import CDiscount
       ^
<unknown>:0: error: build had 1 command failures
error: exit(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/zk/Developer/Server/Project11/.build/debug.yaml

With -Xlinker and -target, but not -Xcc

➜  Project11 swift build -Xlinker -L/usr/local/lib -Xswiftc -target -Xswiftc x86_64-apple-macosx10.12
note: you may be able to install libmarkdown using your system-packager:

    brew install discount

note: you may be able to install libmarkdown using your system-packager:

    brew install discount

note: you may be able to install libmarkdown using your system-packager:

    brew install discount

Compile Swift Module 'Markdown' (3 sources)
Compile Swift Module 'Jay' (21 sources)
Compile Swift Module 'libc' (1 sources)
Compile Swift Module 'Polymorphic' (2 sources)
Compile Swift Module 'PathIndexable' (2 sources)
Compile Swift Module 'SwiftSlug' (1 sources)
Compile Swift Module 'Spectre' (8 sources)
Compile Swift Module 'KituraTemplateEngine' (1 sources)
Compile Swift Module 'Cryptor' (10 sources)
Compile Swift Module 'SwiftyJSON' (2 sources)
Compile Swift Module 'Socket' (3 sources)
Compile Swift Module 'LoggerAPI' (1 sources)
Compile Swift Module 'Core' (29 sources)
Compile Swift Module 'HeliumLogger' (2 sources)
Compile Swift Module 'Node' (22 sources)
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cdiscount.h"
        ^
/Users/zk/Developer/Server/Project11/.build/checkouts/CDiscount.git-4318135343521947030/cdiscount.h:22:10: error: 'mkdio.h' file not found
#include <mkdio.h>
         ^
/Users/zk/Developer/Server/Project11/.build/checkouts/Markdown.git--5008474681835546292/Sources/Markdown/Markdown.swift:22:8: error: could not build Objective-C module 'CDiscount'
import CDiscount
       ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cdiscount.h"
        ^
/Users/zk/Developer/Server/Project11/.build/checkouts/CDiscount.git-4318135343521947030/cdiscount.h:22:10: error: 'mkdio.h' file not found
#include <mkdio.h>
         ^
/Users/zk/Developer/Server/Project11/.build/checkouts/Markdown.git--5008474681835546292/Sources/Markdown/Markdown.swift:22:8: error: could not build Objective-C module 'CDiscount'
import CDiscount
       ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cdiscount.h"
        ^
/Users/zk/Developer/Server/Project11/.build/checkouts/CDiscount.git-4318135343521947030/cdiscount.h:22:10: error: 'mkdio.h' file not found
#include <mkdio.h>
         ^
/Users/zk/Developer/Server/Project11/.build/checkouts/Markdown.git--5008474681835546292/Sources/Markdown/Markdown.swift:22:8: error: could not build Objective-C module 'CDiscount'
import CDiscount
       ^
<unknown>:0: error: build had 1 command failures
error: exit(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/zk/Developer/Server/Project11/.build/debug.yaml

The "working" command

➜  Project11 swift build -Xcc -I/usr/local/include -Xlinker -L/usr/local/lib -Xswiftc -target -Xswiftc x86_64-apple-macosx10.12
note: you may be able to install libmarkdown using your system-packager:

    brew install discount

note: you may be able to install libmarkdown using your system-packager:

    brew install discount

note: you may be able to install libmarkdown using your system-packager:

    brew install discount

Compile Swift Module 'Markdown' (3 sources)
Compile Swift Module 'libc' (1 sources)
Compile Swift Module 'Polymorphic' (2 sources)
Compile Swift Module 'Jay' (21 sources)
Compile Swift Module 'PathIndexable' (2 sources)
Compile Swift Module 'SwiftSlug' (1 sources)
Compile Swift Module 'Spectre' (8 sources)
Compile Swift Module 'Cryptor' (10 sources)
Compile Swift Module 'KituraTemplateEngine' (1 sources)
Compile Swift Module 'SwiftyJSON' (2 sources)
Compile Swift Module 'Socket' (3 sources)
Compile Swift Module 'LoggerAPI' (1 sources)
Compile Swift Module 'Core' (29 sources)
Compile Swift Module 'HeliumLogger' (2 sources)
Compile Swift Module 'Node' (22 sources)
Compile Swift Module 'PathKit' (1 sources)
Compile Swift Module 'Stencil' (19 sources)
Compile Swift Module 'KituraStencil' (1 sources)
Compile Swift Module 'JSON' (9 sources)
Compile Swift Module 'MySQL' (11 sources)
Compile Swift Module 'SSLService' (1 sources)
Compile CHTTPParser http_parser.c
Compile CHTTPParser utils.c
Linking CHTTPParser
Compile Swift Module 'KituraNet' (34 sources)
Compile Swift Module 'Kitura' (43 sources)
Compile Swift Module 'project11' (1 sources)
Linking ./.build/debug/project11

Build error (Swift 3.0 Xcode 8.0 Beta 2)

Added to Package.swift, then on swift build:

Cloning https://github.com/crossroadlabs/CDiscount.git
HEAD is now at 207cbc3 added modulemap
Resolved version: 0.1.0
Compile Swift Module 'Markdown' (3 sources)
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cdiscount.h"
        ^
/.../Packages/CDiscount-0.1.0/cdiscount.h:22:10: error: 'mkdio.h' file not found
#include <mkdio.h>
         ^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.