我有一堆像这样格式化的数据,在预标签中显示效果很好:
1: Here's my first row, and it is
quite long...
and can span over several rows.
2: This is the second row.
但是,我希望对它有一些控制权,可能会把它变成html:
<ol>
<li>Here's my first row, and it is<br/>quite long...<br/>and can span over several rows.</li>
<li>This is the second row</li>
</ol>
我似乎无法在线找到pre-to-html-converter。我该怎么做呢?
干杯!
答案 0 :(得分:2)
将文本文件转换为HTML的常用工具是Markdown和Textile。每个都有很多实现(和维基百科列表8 JS implementations of Markdown)。
我怀疑开箱即可适应你所拥有的特定文本,但他们的源代码应该是一个合理的起点。
答案 1 :(得分:1)
尝试使用Wiki标记引擎like the one that SO uses。