maryvilledev / codesplain-embedded

0 stars 0 forks source link

Use tags array for node type in new snippets #43

Closed Hopding closed 7 years ago

Hopding commented 7 years ago

Fixes #42.

This PR makes the highlightNode function detect whether a snippet's AST was generated by the new or the old parser, and handles the highlighting accordingly. If the AST was generated by the old parser, the node's type property is used. If it was generated by the new one, then the last element of its tags array is used.