From b3a8925fdb7d55d9a7c4326d497c3c3a7ec9bab1 Mon Sep 17 00:00:00 2001
From: marihachi <marihachi0620@gmail.com>
Date: Sat, 2 Oct 2021 10:27:05 +0900
Subject: [PATCH] update doc

---
 docs/api.md | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/docs/api.md b/docs/api.md
index bad44a5..75ae293 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -4,11 +4,27 @@
 
 例:  
 ```ts
-const nodes = mfm.parse('hello [tada world]');
+const nodes = mfm.parse('hello $[tada world]');
 console.log(JSON.stringify(nodes));
 // => "[{"type":"text","props":{"text":"hello "}},{"type":"fn","props":{"name":"tada","args":{}},"children":[{"type":"text","props":{"text":"world"}}]}]"
 ```
 
+### 利用可能なMFM関数のリストを設定する
+MFM関数の名前をホワイトリストに登録して、登録されたMFM関数以外を通常のテキストノードとして解釈するように設定できます。
+デフォルトではすべてのMFM関数名を受け入れるように設定されています。
+
+```ts
+const nodes = mfm.parse('hello $[tada world]', { fnNameList: ['tada', 'spin'] });
+console.log(JSON.stringify(nodes));
+// => "[{"type":"text","props":{"text":"hello "}},{"type":"fn","props":{"name":"tada","args":{}},"children":[{"type":"text","props":{"text":"world"}}]}]"
+```
+
+```ts
+const nodes = mfm.parse('hello $[pope world]', { fnNameList: ['tada', 'spin'] });
+console.log(JSON.stringify(nodes));
+// => "[{"type":"text","props":{"text":"hello $[pope world]"}}]"
+```
+
 ## parsePlain API
 入力文字列からノードツリーを生成します。  
 絵文字コードとUnicode絵文字を利用可能です。  
@@ -25,7 +41,7 @@ console.log(JSON.stringify(nodes));
 
 例:  
 ```ts
-const nodes = mfm.parse('hello [tada world]');
+const nodes = mfm.parse('hello $[tada world]');
 const output = mfm.toString(nodes);
 console.log(output); // => "hello [tada world]"
 ```
-- 
GitLab