Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
SVG

<text>elements do not support HTML<sub>elements in their content.Vamonos.resolveSubscriptuses<sub>tags to render subscripts, which works great for subscripts rendered in HTML (such as Gf in the following screenshot), but does not work for subscripts rendered in SVG (such as tf in the following screenshot). This means that graphs currently render with the<sub>tags printing in plaintext:Instead of using
<sub>elements in SVG,<tspan>can be used to style a subset of text within an SVG text block.Vamonos.resolveSvgSubscriptuses this to style subscripts for SVG. These subscripts are styled:baseline-shift='sub'to render below the normal text line in the SVG wayfont-size='75%'to match Bootstrap's size difference for subscripts (applied to<sub>tags in HTML)This fixes the subscripts in the graphs without breaking subscripts rendered in HTML:

Important
This also changes the graph's vertex labels to render as HTML instead of escaped text (escaping text was a second problem making the
<sub>tags visible in the graph). Labels are already rendered as HTML outside the graph so that the<sub>tags work properly, so this seems like a reasonable choice here as well. However, if a user were to create a vertex label like "<a>", this would render as a (broken) anchor tag instead of the literal string "<a>".