From 644c94bffee560a45c9b12ba1c07348bd7837b31 Mon Sep 17 00:00:00 2001 From: othree Date: Mon, 21 Mar 2011 16:32:49 +0800 Subject: [PATCH] code span --- syntax.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/syntax.md b/syntax.md index 0c04f57..dd58ab2 100644 --- a/syntax.md +++ b/syntax.md @@ -1025,31 +1025,44 @@ To indicate a span of code, wrap it with backtick quotes (`` ` ``). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example: +如果要標記一小段行內程式碼,你可以用反引號把它包起來 (`` ` ``),例如: + Use the `printf()` function. will produce: +會產生: +

Use the printf() function.

To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters: +如果要在程式碼區段內插入反引號,你可以用多個反引號來開啟和結束程式碼區段: + ``There is a literal backtick (`) here.`` which will produce this: +這段語法會產生: +

There is a literal backtick (`) here.

The backtick delimiters surrounding a code span may include spaces -- one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span: +程式碼區段的起始和結束端都可以放入一個空白,起始端後面一個,結束端前面一個, +這樣你就可以在區段的一開始就插入反引號: + A single backtick in a code span: `` ` `` A backtick-delimited string in a code span: `` `foo` `` will produce: +會產生: +

A single backtick in a code span: `

A backtick-delimited string in a code span: `foo`

@@ -1058,18 +1071,27 @@ With a code span, ampersands and angle brackets are encoded as HTML entities automatically, which makes it easy to include example HTML tags. Markdown will turn this: +在程式碼區段內, `&` 和角括號都會被轉成 HTML 實體,這樣會比較容易插入 HTML 原始碼, +Markdown 會把下面這段: + Please don't use any `` tags. into: +轉為: +

Please don't use any <blink> tags.

You can write this: +你也可以這樣寫: + `—` is the decimal-encoded equivalent of `—`. to produce: +以產生: +

&#8212; is the decimal-encoded equivalent of &mdash;.