Code Monkey home page Code Monkey logo

Comments (8)

kylelaker avatar kylelaker commented on August 23, 2024 2
  • It probably should deal with both viewing/editing in markdown in some way

Any sort of complicated editing capabilities are not required as part of the initial implementation of markdown support. Only viewing is necessary for the initial component.

from oscal-react-library.

kylelaker avatar kylelaker commented on August 23, 2024 1

Markdown + the url parameter needs to be careful to not accidentally open up an XSS vulnerability.

from oscal-react-library.

kylelaker avatar kylelaker commented on August 23, 2024 1

https://github.com/remarkjs/react-markdown is another possible render.

from oscal-react-library.

tuckerzp avatar tuckerzp commented on August 23, 2024 1

@schen2166 & @kperk103 I wanted to also post the rough plan for getting this done here so more people can see.

  1. Create the OSCALMarkdownProse component
    • At the most basic level it would export a ReactMarkdown component remarkjs/react-markdown: Markdown component for React (github.com)
    • It probably should deal with both viewing/editing in markdown in some way? I am not 100% on this aspect and think you two may know a bit more than me on it.
    • Tests should be easy and also means we do not have to actually implement it anywhere to merge in this pr
    • A very initial draft pr should be made by tomorrow afternoon. This can be extremely basic. Just start getting discussion going since people will most likely have opinions on implementation.
  2. Implement the component where it makes sense
    • This will require some planning to split it up in a logical way
    • Hopefully your component makes this super easy to more or less just paste in
    • E2E tests should cover this and make it really easy? You might be able to get away with just component testing though.

Lets try to keep as much of the discussion on planning here and to use draft prs a lot. I think this task should be pretty easy with good planning but could easily get a little messy.

from oscal-react-library.

kylelaker avatar kylelaker commented on August 23, 2024

https://marked.js.org/ or something like it could be an option. But we'd definitely want to sanitize and probably find a way to strip any <script> or maybe even <style> tags in a sanitization process (since many Markdown parsers support raw HTML). A nice thing about Markdown is that it's fairly readable as-is without being rendered. We may want to consider using workers to asynchronously perform the rendering as well and we can cancel them if they work for too long.

What we really want to avoid is me being able to make a "malicious" control catalog and passing around links that load scripts or that make the UI thread lock up rendering markdown. Of course, the other thing would be if our default catalog that we load had a buggy markdown somewhere that did the same thing.

I am maybe being a little overly cautious here. There are probably other places that we're loading data from the internet and displaying it to users but this is one where we have far less control over the rendering pipeline.

from oscal-react-library.

schen2166 avatar schen2166 commented on August 23, 2024

Issue #556 is another subtask where there was markup written in prose in the backmatter. The commit there addresses the necessary changes for the backmatter

from oscal-react-library.

naiqbal avatar naiqbal commented on August 23, 2024

@kylelaker @brian-easyd Demo of Issue #156 for acceptance https://easydynamics-my.sharepoint.com/:v:/p/niqbal/EVohd_Csn51OnQ09gFAH2osB65GDEKvCnjOI69rnAWNQ9A?e=ysfjUo

from oscal-react-library.

brian-comply0 avatar brian-comply0 commented on August 23, 2024

I agree this is complete

from oscal-react-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.