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

388 clickable links #405

Merged
merged 15 commits into from
Nov 6, 2023
Merged

388 clickable links #405

merged 15 commits into from
Nov 6, 2023

Conversation

kennethbruskiewicz
Copy link
Collaborator

@kennethbruskiewicz kennethbruskiewicz commented Aug 21, 2023

Addresses #388, particularly in light of comment #388 (comment) where @pkalita-lbl considered Markdown support.

(Note: as this is my first contribution I'm setting it up as a draft PR, as it may reflect misunderstandings of the codebase.)

Changelog

  • Creates a utils called content.js where formatters pertaining to content, rather than data fields, can be placed.
  • In content.js, adds url2markdown and url2anchor methods to use on arbitrary text.
  • In content.js, adds support of the Marked parser and exposes one to other modules as renderContent.
  • Renders the content of the HelpSidebar and toolbarGettingHelp components in Markdown.

Further Investigations

  • Is this enough to warrant modularizing the content into Markdown documents?
  • Are there simpler or smaller or more performant parsers to use than Marked?
  • Should I standardize this code to a non-ECMA6 style?
  • What would be a more general way to ensure all content is markdown-based on the page?

@kennethbruskiewicz kennethbruskiewicz self-assigned this Aug 21, 2023
@kennethbruskiewicz kennethbruskiewicz added bug Something isn't working wip Work in progress dependencies Pull requests that update a dependency file labels Aug 21, 2023
@kennethbruskiewicz
Copy link
Collaborator Author

It looks like this issue also appears downstream?

microbiomedata/nmdc-server#945
microbiomedata/nmdc-server#1041
microbiomedata/nmdc-server#820

@ddooley
Copy link
Collaborator

ddooley commented Aug 21, 2023 via email

@pkalita-lbl
Copy link
Collaborator

Just to give some context on the related NMDC issues. This idea did originally in that project, and it would still be beneficial there. However the biggest impetus in that project was actually a component outside of DataHarmonizer where help information from the schema is also displayed. For that work we were really only concerned about linking bare URLs, and we chose to use https://github.com/markdown-it/linkify-it because basic we found simple regex-based approaches to not be robust enough.

The same people who make that package also make a full-blown markdown parser: https://github.com/markdown-it/markdown-it I might suggest looking into that package because it has bare URL linking and takes care of certain security issues by default.

@kennethbruskiewicz kennethbruskiewicz marked this pull request as ready for review November 6, 2023 17:36
@kennethbruskiewicz kennethbruskiewicz merged commit b65521f into master Nov 6, 2023
1 check passed
@kennethbruskiewicz kennethbruskiewicz linked an issue Nov 8, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file wip Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transform URLs in help popup into clickable links
3 participants