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

Edit Dataset Metadata: string field values contain markdown #499

Open
ekraffmiller opened this issue Sep 21, 2024 · 1 comment
Open

Edit Dataset Metadata: string field values contain markdown #499

ekraffmiller opened this issue Sep 21, 2024 · 1 comment
Labels
bug Something isn't working GREI Re-arch GREI re-architecture-related SPA: Edit Dataset Page

Comments

@ekraffmiller
Copy link
Contributor

ekraffmiller commented Sep 21, 2024

What steps does it take to reproduce the issue?

Create a Dataset with a description that contains html markup, for example <b>test</b>.
View the Dataset and see that the description is displayed as test (correctly displayed as bold).
Choose Edit Metadata.
In the EditMetadata form, the description is shown as Markdown instead of html, for example **test**.
If the Dataset is saved again, the description test is converted again the Markdown, so it appears as **test**, rather than test.

  • When does this issue occur?
    Editing Dataset Metadata that contains html markup

  • Which page(s) does it occur on?
    Edit Dataset Metadata

  • What happens?
    Metadata field value is displayed with Markdown rather than html

  • To whom does it occur (all users, curators, superusers)?
    all users

  • What did you expect to happen?
    The metadata value should be displayed with the html markup that is returned by the Dataverse API

Note: This will probably require a change to js-dataverse also, either to stop converting the html to markdown get Get Dataset use case, or have that conversion happen optionally.

Any related open or closed issues to this bug report?

Screenshots:

Markdown.in.metadata.field.mov
@ekraffmiller ekraffmiller added bug Something isn't working SPA: Edit Dataset Page GREI Re-arch GREI re-architecture-related labels Sep 21, 2024
@g-saracca
Copy link
Contributor

g-saracca commented Oct 2, 2024

I would be inclined to avoid html to markdown transformations in js-dataverse.
This way the information is not modified and the js-dataverse consumer can handle the field as desired.
Saying that, I would love to make a special component similar to how Github handles comments, where the user can write both markup and html and can see the preview of it.
Then, from the SPA, before sending the markup collected by the component to the js-dataverse use case, this markup would be transformed back to html, so we only send "html" from the SPA at the end.
Then for the case of editing a dataset, when receiving the html from the use case, a transformation from html to markdown would have to be done inside the SPA to fill the form field.

I have some doubts:

  • Dataverse backend would or is supporting all kind of html tags that could be generated from a markdown?
  • Another point would be to know when a metadata field can be filled with html, to know when to render this custom "rich text editor component", maybe all metadata fields of type “TEXTBOX”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GREI Re-arch GREI re-architecture-related SPA: Edit Dataset Page
Projects
Status: No status
Development

No branches or pull requests

2 participants