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

fix: underscore escape while html transforming #242

Conversation

ChengShi-1
Copy link
Contributor

@ChengShi-1 ChengShi-1 commented Jan 21, 2025

What this PR does / why we need it:

Fix the bug that the underscore are escaped with backslashes and accumulate.
After investigating, the function transformHtmlToMarkdown leads the underscore format problem, for example, input: "test_" would be transformed to "test\_". This error isn't followed with other symbols, only underscore.

After I give an underscore to the title, the test information looks like this
Screenshot 2025-01-19 at 10 48 36 PM

Which issue(s) this PR closes:

Special notes for your reviewer:

Suggestions on how to test this:

Even though this is a js-dataverse repo PR, the test has to be done on front end SPA page.
Environment Setting: in package.json, change to "@iqss/dataverse-client-javascript": "v2.0.0-pr242.cbb959e", runnpm i, and run npm run build, may need restart docker as well.

  1. create a dataset, give a title, subtitle or email(any text area) with underscore _, such as [email protected]
  2. edit the dataset metadata randomly, but keep the underscore
  3. check the information display in the dataset page, underscore should be there without any strangely backslash.

image

@ChengShi-1 ChengShi-1 linked an issue Jan 21, 2025 that may be closed by this pull request
@ChengShi-1 ChengShi-1 marked this pull request as ready for review January 21, 2025 18:28
@ChengShi-1 ChengShi-1 added SPA.Q1 Not related to any specific Q1 feature bug Something isn't working Size: 3 A percentage of a sprint. 2.1 hours. SPA: Dataset View Page GREI Re-arch GREI re-architecture-related Original size: 3 FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) labels Jan 21, 2025
@ekraffmiller ekraffmiller self-assigned this Jan 23, 2025
@ekraffmiller
Copy link
Contributor

ekraffmiller commented Jan 27, 2025

Closing this because it will be addressed by IQSS/dataverse-frontend#588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA: Dataset View Page SPA.Q1 Not related to any specific Q1 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

underscores are escaped strangely with backslashes and accumulate
2 participants