Closed FoxyHunter7 closed 9 months ago
Will investigate!
Mermaid don't support this, I have made an workaround and replaced the / with _ in the new version: https://github.com/R0tenur/visualization/releases/tag/v0.9.2
this indeed fixes when there's a /
.
Hover, unfortunately there are a lot more things that are allowed in sqlserver that can break mermaid syntax, such as %
, etc...
Anything that can be regarded as markdown syntax can break it.
I have done some research myself, and it seems like it is impossible to do special character escapement in that place in mermaid.
so perhaps it would be possible to not only replace /
but also some other, or at least something that can detect special characters, and warn the user that special characters were used in the column name(s) and that it may or may not break stuff.
Never the less, thanks for the quick reaction.
Yes I decided to do a quick fix for this and another persons issue with columns starting with numbers. Next step would be to capture more and produce a warning. And last, might try to make it possoble to revolve https://github.com/mermaid-js/mermaid/issues/1546 on the mermaid side
In T-SQL it is possible to make a column with a name that has a
![image](https://github.com/R0tenur/visualization/assets/80623140/bf492c16-ddb0-456a-bed1-c42e4197d685)
/
in it. This/
will will mess up the mermaid syntax, and generating a preview will fail. See images below:This is an example with a
/
however, by using square brackets, it is possible to use many special characters as column name in T-SQL.Expected Behavior
In this case it is expected that this fails, for the reason above, however the desired behaviour would be that it can still show the schema.
Current Behavior
As described above, the mermaid syntax is invalid and schema visualisation fails.![image](https://github.com/R0tenur/visualization/assets/80623140/7e8248b8-f1fa-4f21-9d5c-41281fd1a55f)
Possible Solution
Make the parser aware of these special symbols so that it can either remove or deal with them properly in the mermaid syntax. in the screenshot of the MD provided above, removing the
/
solves the issue and mermaid shows schema properly.Steps to Reproduce
/
)