Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

Markdown

最終更新 Markdown で表示Agent セットアップ

このコンポーネントは marked を使い、CommonMark および各種 Markdown 方言 を描画します。

import { Markdown } from "~/components";

<Markdown text="**foo** <br/> [bar](/style-guide/build-the-page/components/markdown/)" />

パーシャル内の変数の例

特別な書式が必要な変数(URL、箇条書きなど)がある場合は、パーシャルファイル内で Markdown コンポーネントで変数を囲めます。例:

<Markdown text={props.foo} />

変数は中括弧({ })で囲み、text= を付ける必要があります。そうしないと動きません。

複数行の文字列

Markdown コンポーネントは dedent ライブラリで、複数行文字列のインデントを取り除きます。

CommonMark 仕様 はインデントされたテキストをコードブロックとして扱います。MDX とは異なります。

import { Markdown } from "~/components";

<>
  <Markdown
  	text={`
    You need to purchase [Cloudflare WAN](https://www.cloudflare.com/magic-wan/) before you can purchase and use the Cloudflare One Appliance. The Cloudflare One Appliance can function as your primary edge device for your network, or be deployed in-line with existing network gear.

  	You also need to purchase a Cloudflare One Appliance before you can start configuring your settings in the Cloudflare dashboard. After buying a Cloudflare One Appliance, the device will be registered with your Cloudflare account and show up in your Cloudflare dashboard.

    Contact your account representative to learn more about purchasing options for the Cloudflare One Appliance device.
    `}
    inline={false}
  />
</>

役に立ちましたか?