Extracts a table-of-contents from some Cardscript.
$ npm install cardscript-table-of-contents --save
const extractToc = require('@wmfs/cardscript-table-of-contents')
const toc = extractToc(
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Change me!",
"color": "attention",
"horizontalAlignment": "center"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
)
$ npm test