Skip to content
Snippets Groups Projects
Commit 11fefdff authored by marihachi's avatar marihachi
Browse files

docs

parent c75f8d22
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ console.log(JSON.stringify(nodes)); ...@@ -9,7 +9,7 @@ console.log(JSON.stringify(nodes));
// => [{"type":"text","props":{"text":"hello "}},{"type":"fn","props":{"name":"tada","args":{}},"children":[{"type":"text","props":{"text":"world"}}]}] // => [{"type":"text","props":{"text":"hello "}},{"type":"fn","props":{"name":"tada","args":{}},"children":[{"type":"text","props":{"text":"world"}}]}]
``` ```
### 利用可能なMFM関数のリストを設定する ### 利用可能なMFM関数やカスタム絵文字のリストを設定する
MFM関数の名前をホワイトリストに登録して、登録されたMFM関数以外を通常のテキストノードとして解釈するように設定できます。 MFM関数の名前をホワイトリストに登録して、登録されたMFM関数以外を通常のテキストノードとして解釈するように設定できます。
デフォルトではすべてのMFM関数名を受け入れるように設定されています。 デフォルトではすべてのMFM関数名を受け入れるように設定されています。
...@@ -26,6 +26,15 @@ console.log(JSON.stringify(nodes)); ...@@ -26,6 +26,15 @@ console.log(JSON.stringify(nodes));
// => [{"type":"text","props":{"text":"hello $[pope world]"}}] // => [{"type":"text","props":{"text":"hello $[pope world]"}}]
``` ```
同様に、カスタム絵文字の名前もホワイトリスト制にできます。
例:
```ts
const nodes = mfm.parse(':bap:', { emojiCodeList: ['polarbear', 'bap'] });
console.log(JSON.stringify(nodes));
// => [{"type":"emojiCode","props":{"name":"bap"}}]
```
### 最大のネストの深さを変更する ### 最大のネストの深さを変更する
デフォルトで20に設定されています。 デフォルトで20に設定されています。
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment