Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant get line breaks in Table Comments to work. #1401

Open
dmarkey opened this issue Jan 25, 2024 · 6 comments
Open

Cant get line breaks in Table Comments to work. #1401

dmarkey opened this issue Jan 25, 2024 · 6 comments

Comments

@dmarkey
Copy link

dmarkey commented Jan 25, 2024

Expected Behavior

That I can have a line break in the output with this schema metadata

<schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemaspy.org/xsd/6/schemameta.xsd" >
    <comments>Database comment</comments>
    <tables>
        <table name="usr" comments="Line \n with  \n no  \n hardbreak  \n">
            <column name="username" comments="Column comment"/>
        </table>
    </tables>
</schemaMeta>

I've tried several permutations and cant get a line break to work.

Thank you!

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

  • Database type (e.g. MySQL): PG
  • Database driver version (is you use a special one):
  • Your DDL (sample how to reproduce the issue):
  • Full command including arguments how you run SchemaSpy:

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39):
  • Operating System and version (e.g. Windows 10):
  • Java version:
@dmarkey
Copy link
Author

dmarkey commented Jan 25, 2024

image

@npetzall
Copy link
Member

I haven't had time yet, but it's going to pass thru markdown processing so at least two spaces are needed before the line break.

But since it's imported from the SchemaMeta I wonder if some escaping is needed. Escaping to avoid the escaping since it seems to render it as \n.

Since it goes thru markdown it might be possible with <br/> but there is a risk that it will be escaped and rendered as is.

I'll see if I get a chans to look at it today.

@dmarkey
Copy link
Author

dmarkey commented Jan 25, 2024

Thank you!

@npetzall
Copy link
Member

npetzall commented Jan 25, 2024

Got to testing <br /> break XML syntax. The \n isn't translated correctly from XML to String in java(DocumentBuilder), so that doesn't yield the desired outcome. However DocumentBuilder translates html codes.

So to get the line breaks it's space + space +

<schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemaspy.org/xsd/6/schemameta.xsd" >
    <comments>Database comment</comments>
    <tables>
        <table name="usr" comments="Line  &#10;with  &#10; no  &#10; hardbreak  \n">
            <column name="username" comments="Column comment"/>
        </table>
    </tables>
</schemaMeta>

@dmarkey
Copy link
Author

dmarkey commented Jan 26, 2024

Thanks!

Think we'll go the DB comment route.

Sorry slightly unrelated, do you know if there's a way to colour text?

@npetzall
Copy link
Member

@dmarkey markdown doesn't have that support. We could look if the framework we use has an extension for it. But no support at the moment, the only workarounds for it are really cumbersome by adding style sheet elements to the prior to the markdown, and it's too horrible to work with, so I would suggest to avoid it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants