Passing a single Node to mermaid.init() results in an error, as it
calls `new NodeList()`, which causes `TypeError: Illegal constructor`.
See 5597cf45bf/src/mermaid.ts (L73)
If we instead use the `ArrayLike` interface, we can just use a simple
array, instead of a NodeList.
I've also added a basic test case, by mocking the `mermaidAPI.render()`
function so it isn't called, as the d3 functions don't work in Node.JS.
The mocks are a bit messy, since
a) Jest doesn't fully support ESM yet, and
b) mermaidAPI is frozen with `Object.freeze()`,
but the mermaidAPI mocks work as long as we keep them simple.
Fixes: c68ec54fdd980a6b4d1c1b58aec991badba16676
gitGraph does not support branch names that start with a number,
because the gitGraph.jison file parses these as NUM (number) instead.
To fix this, I've changed the NUM parser to only accept strings that
end with whitespace (e.g 1234 is a NUM, but 1234abc is not a NUM).
To do this, I had to move the "skip all whitespace" step to the
end of the parser, but this doesn't seem to have caused any issues,
so it's probably fine.
* develop: (50 commits)
Typo fix
Fix repo URL
Revert flowchart change
Revert flowchart change
Fix TODO Qs
chore(deps-dev): bump @commitlint/cli from 17.1.1 to 17.1.2
chore(deps-dev): bump terser-webpack-plugin from 5.3.5 to 5.3.6
chore(deps-dev): bump webpack-dev-server from 4.10.0 to 4.10.1
Fix gitGraph findLane function error
Update dependabot.yml
Replacing replaceAll with replace
Rework 'parseDuration' as a pure duration parsing
Supports duration in decimal
Create a more consistent 'parseDuration'
Remove `@ts-ignore`s.
Fix svgDraw return types
...