Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a Show tokens option to the test page.
The purpose of this option is to make the nested structure and range of tokens visible.
This is useful for both the developing and reviewing process because it visualizes the output token stream of Prism with greater detail than simple highlighting.
When enabled, it will surround each token with a solid 1px border and give it a 1px margin to other tokens. The border color is the font color of the token.
To enable the option, click the new checkbox:
Images
Overview:
The nested structure of a
tag
token is clearly visible:Empty tokens are made visible:
Limitations
Only a maximum of 4 nested levels can be visualized using borders. Greater than level 4 tokens will be displayed like this:
You have to try quite hard to get more than 4 nested levels of tokens, so this shouldn't happen too often.
Browser support
Everything is tested and working on the latest versions of Chrome, Opera, Firefox, Edge, and IE11.