MarkdownAttributedString
MarkdownAttributedString copied to clipboard
Adding Markdown support to NSAttributedString.
Setting `NSUnderlineStyleAttributeName` in `MarkdownStyleEmphasisSingle` only seems to work if `MarkdownStyleEmphasisDouble` is defined as well that contains a significant attributed style difference. Use case underlining "bar" in "Foo _bar_". Using `SampleApp`'s...
This builds upon https://github.com/chockenberry/MarkdownAttributedString/pull/2 by adding an SPM package. SPM was the easiest to wrangle by moving the source files down a level.
There is some time since I don't write Objc, please feel free to suggest improvements. Fix #8
As this snippet shows if there is a `styleAttributes` for links the url attribute is ignored. https://github.com/chockenberry/MarkdownAttributedString/blob/750e8d5cb455dcc592a9b6d1cacaa19837e7abff/NSAttributedString%2BMarkdown.m#L474-L479 I need to customise the link color and keep them tappable. I'll send...
In the function updateAttributedString(): `endRange = [scanString rangeOfString:endMarker options:options range:remainingRange];` It doesn't check for an escaped endMarker: `if (hasCharacterRelative(scanString, endRange, -1, escapeCharacter)) { continueScan = YES; //scanEndIndex = endRange.location +...
Example: `[It's a link, but it won't be (converted) to NSAttributedString.Key.link](https://google.com)`
See attached unit tests. [NSAttributedString+Markdown_Tests.m.txt](https://github.com/chockenberry/MarkdownAttributedString/files/4611966/NSAttributedString%2BMarkdown_Tests.m.txt)
See attached unit tests. [NSAttributedString+Markdown_Tests.m.txt](https://github.com/chockenberry/MarkdownAttributedString/files/4611967/NSAttributedString%2BMarkdown_Tests.m.txt)
NSString *content = @"好的呀,给你找到了一些附近的充电站信息:\n\n1. **【易充网】南京市鼓楼区水佑岗22号小区旁(路边站点)**\n - 空闲桩数:3\n - 快充当前价格:1.16元\n - 停车描述:按路边收费标准收费\n - 距离:743.34米\n\n2. **【易充网】南京市鼓楼区龙园东路桥下(路边站点)**\n - 空闲桩数:1\n - 快充当前价格:1.16元\n - 停车描述:按路边收费标准收费\n - 距离:845.25米\n\n3. **清凉山体校超充站**\n - 空闲桩数:8\n - 快充当前价格:0.97元(已减0.12元)\n - 停车描述:绑定车牌充电免停90分钟,超时以场站收费为准\n -...