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

Line break in help text #205

Open
jycr opened this issue Sep 7, 2023 · 4 comments
Open

Line break in help text #205

jycr opened this issue Sep 7, 2023 · 4 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@jycr
Copy link

jycr commented Sep 7, 2023

Is it possible to have line break in help description?

Following config does not work:

{
  "fields": [
    {
      "label": "Working directory",
      "key": "workingDir",
      "type": "file",
      "help": "Lorem ipsum dolor sit amet.\nVestibulum ante ipsum primis in faucibus."
    },
  ]
}
image
@jycr jycr added the enhancement New feature or request label Sep 7, 2023
@pvrobays
Copy link
Collaborator

Hi @jycr

This is not possible by default. We don't parse the text as HTML. We just pass the text to react which renders it within a span element.

You could create a workaround where you add your custom CSS which adds the white-space: pre; attribute to the .help CSS class. This is the class that's used on the help span element.
I didn't try this, but I assume in that case your \n character will be interpreted as a new line.

@pvrobays
Copy link
Collaborator

I'll mark this as won't fix. Can you verify the workaround?

@pvrobays pvrobays added the wontfix This will not be worked on label Sep 14, 2023
@lacymorrow
Copy link
Collaborator

Does <br /> not work?

@pvrobays
Copy link
Collaborator

Does <br /> not work?

I don't think so. We just pass the config variable on to the html tag in React. If you want to parse the variable as HTML, you need to use the dangerouslySetInnerHTML property.
It could be an option to make this work as the input is coming from devs, not from end-users so you can 'trust' the input. However, I think using the preformatted html tag is a better fit in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants