在标记中使用斜体来表示以星形结尾的单词(Using italic in markdown for words that end with a star)

编程入门 行业动态 更新时间:2024-10-27 04:28:58
在标记中使用斜体来表示以星形结尾的单词(Using italic in markdown for words that end with a star)

我不太确定在哪里提出这个问题以及StackOverflow是否是正确的地方,所以如果不是,请道歉。 无论如何,虽然我的问题与编程本身没有直接关系,但它涉及与编程相关的任务:编写文档。

我使用GitHub-Flavored Markdown编写文档,在一个关于Web服务的文档中,我使用术语WS-* 。 现在我想通过使它成斜体来强调这个术语,所以通常我这样做:

*foo*

WS-*现在的问题是它已经以星号结束,所以我得到:

*WS-**

我的Markdown解析器无法正确识别,因为它将此解释为open italic并close bold 。

如何在与标准兼容的有效Markdown中正确地编写它(因此可以与符合标准的解析器一起使用)?

I'm not quite sure where to ask this question and whether StackOverflow is the right place, so please apologize if it is not. Anyway, although my question is not directly related to programming itself, it concerns a task that is related to programming: Writing documentation.

I write documentation using GitHub-Flavored Markdown, and in one document on web services I am using the term WS-*. Now I want to emphasize this term by making it italic, so usually I do this like this:

*foo*

The problem with WS-* now is that it already ends with a star, so I get:

*WS-**

Which is not correctly recognized by my Markdown parser, as it interpretes this as open italic and close bold.

How can I correctly write this in valid Markdown, that is compatible to the standard (and hence works with standard-compliant parsers)?

最满意答案

像这样使用_single underscores_ :

_WS-*_

它导致了

<em>WS-*</em>

它符合标准 。

Use _single underscores_ like this:

_WS-*_

It results in

<em>WS-*</em>

It's standard-compliant.

更多推荐

本文发布于:2023-07-23 04:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1227568.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:星形   斜体   单词   结尾   标记

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!