Skip to content

Conversation

@wes-nz
Copy link

@wes-nz wes-nz commented Mar 8, 2018

📝 Description

Having emoji breaks the parsing. The Indexes used were not UTF16.
This is fixing the issue #28 / #29

👎 Existing Behaviour

let breakingString = " *hello* .  *hello*  cncnc cncnc  *hello*  hmm\n  *hello*  🦌🐎🦌🐎\n  *hello*  Screen Shot 2017-10-12 at 11.04.58 AM.png  *hello*  vVe2keakU8.gif  *hello*   *hello* "
var parser: Parser = {
    let parser = Parser()

    parser.add(pattern: MDBoldPattern()) { (string, attributes) -> MatchedResponse in
        return MatchedResponse(string: string, attributes: [NSAttributedStringKey.font: NSFont.boldSystemFont(ofSize: 20)])
    }
    
    parser.add(pattern: MDEmphasisPattern()) { (string, attributes) -> MatchedResponse in
        return MatchedResponse(string: string, attributes: [NSAttributedStringKey.font: NSFont.boldSystemFont(ofSize: 20)])
    }
        
    return parser
}()

screen shot 2018-03-09 at 8 44 48 am

👍 Expected Behaviour Now

screen shot 2018-03-09 at 10 13 46 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant