这是一个围绕 hoedown Markdown 解析器的轻量级包装器,将 Markdown 转换为 NSAttributedString
。与现有其他解析器的最大区别在于结果字符串的存储方式。其他解析器倾向于生成 HTML 字符串,而 NORMarkdownParser
生成原生的 NSAttributedString
以及字符串的清除版本,这使得它在用户界面中非常适用,这些界面可能不知道如何渲染 HTML(《UILabel`》、《UITextField`或自定义控件等)
NORMarkdownParser
目前只支持有限的 Markdown 子集,对于不需要/不想支持完整 Markdown 功能的简单应用程序来说更为合适。
支持的 Markdown 方面
该项目正在进行中
:smile:
,这可能需要从 Hoedown 分支。计划是支持 此 emoji 方法,这意味着解析器默认检测 emoji,并且样式会替换代码的 UTF 表示。类似于 GitHub 和其他做法。欢迎为上述或其他功能/修复提出拉取请求。
如果您有任何问题,请随时与我联系。如有错误,请在此 GitHub 上创建一个问题
Henri Normak
The MIT License (MIT)
Copyright (c) 2014 Henri Normak
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.