应该使用 Raku 语法或正则表达式来解析 wiki 标记吗?
我需要使用 TWiki 标记 将数百个文本文件转换为更标准的标记语言(例如 Markdown 或 Asciidoc),而且似乎没有任何可用的工具来执行此操作(pandoc 支持 TWIki 但非常差,即它不仅不可挽回地丢失了大部分标记,而且还丢失了很多内容),我想用 Raku 编写自己的转换器。
乍一看,似乎使用 Raku 语法来完成这项任务是合适的,但我有点担心我可能会遇到一些损坏的标记的问题——我仍然需要以某种方式处理这些问题。那么坚持手动正则表达式以获得更大的灵活性会更明智吗?
如果有人有使用 Raku 语法解析标记的经验,可以分享一下吗?蒂亚!
I need to convert a few hundred text files using TWiki markup to a more standard markup language (e.g. Markdown or Asciidoc) and, as there doesn't seem to be any usable tool for doing this (pandoc supports TWIki but very poorly, i.e. it irretrievably loses not only much of the markup but also a lot of contents), I'd like to write my own converter in Raku.
At first sight, it looks like it would be appropriate to use Raku grammars for this task, but I'm a bit worried that I could have problems with some broken markup -- which I'd still need to handle in some way. So would it be wiser to stick to manual regexes to have more flexibility?
If anybody has any experience with using Raku grammars for parsing markup, could you please share it? TIA!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论