标记任何文本的最佳方式是什么?

时间:2022-09-13 08:01:25

I need users to mark some section of text with custom tags, I can't use the xml based tags as the whole text will be embedded in XML documents and all the < will be converted to html escape code <. I want users to marks some section of text with tags like skip, bookmark, these tags can have attributes also like bookmark name="first". Which is the best way of allowing users to mark text using the BB forum way like [b]abcd[/b] or using {{bookmark name="first"}}. Or is there any better scheme or technique available.

我需要用户使用自定义标签标记一些文本部分,我不能使用基于xml的标签,因为整个文本将嵌入到XML文档中,并且所有 <将转换为html转义码<。我希望用户使用skip,bookmark这样的标签来标记文本的某些部分,这些标签也可以具有像bookmark name="“first”}}。或者是否有更好的方案或技术可用。

I don't want to change the structure of the text as down by the markdown or textile, I just want to tag some section of text, like the phpBB tags. The question is there any other style than phpBB? Like in some software I see {{bookmark name = "abcd"}} style.

我不想通过降价或纺织来改变文本的结构,我只想标记一些文本部分,比如phpBB标签。问题是除了phpBB还有其他任何风格吗?就像在某些软件中我看到{{bookmark name =“abcd”}}样式。

2 个解决方案

#1


The three common markups I know of for this purpose are Markdown (used, I believe, by SO), textile, and BBCode. The first two are commonly used for blog sites and CMS frameworks, and BBCode I think is usually associated with bulletin-board sites. Preview and mapping utilities are available for each.

我知道为此目的的三个常见标记是Markdown(我相信,SO使用),纺织品和BBCode。前两个通常用于博客站点和CMS框架,我认为BBCode通常与公告板网站相关联。每个都有预览和映射实用程序。

#2


You can have a look at the Textile markup language to see if it fits your needs. It has many implementations and nice documentation.

您可以查看Textile标记语言,看它是否符合您的需求。它有许多实现和很好的文档。

#1


The three common markups I know of for this purpose are Markdown (used, I believe, by SO), textile, and BBCode. The first two are commonly used for blog sites and CMS frameworks, and BBCode I think is usually associated with bulletin-board sites. Preview and mapping utilities are available for each.

我知道为此目的的三个常见标记是Markdown(我相信,SO使用),纺织品和BBCode。前两个通常用于博客站点和CMS框架,我认为BBCode通常与公告板网站相关联。每个都有预览和映射实用程序。

#2


You can have a look at the Textile markup language to see if it fits your needs. It has many implementations and nice documentation.

您可以查看Textile标记语言,看它是否符合您的需求。它有许多实现和很好的文档。