Comments (8)
- 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.
Markdown + the url
parameter needs to be careful to not accidentally open up an XSS vulnerability.
from oscal-react-library.
https://github.com/remarkjs/react-markdown is another possible render.
from oscal-react-library.
@schen2166 & @kperk103 I wanted to also post the rough plan for getting this done here so more people can see.
- 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.
- At the most basic level it would export a
- 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.
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.
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.
@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.
I agree this is complete
from oscal-react-library.
Related Issues (20)
- Implement Styles at a Global Scale HOT 8
- Display `props[@name="type"]` for Back Matter resources
- Refactor OSCALLoader HOT 1
- Support editing metadata Responsible Parties
- Support adding/removing metadata Responsible Parties HOT 1
- Create a consistent way of displaying lists of controls HOT 2
- Design how to display a list of controls
- Support viewing a control's class HOT 4
- Support editing a control's class HOT 1
- Support adding/removing a control's class
- Support viewing parameters for catalogs, groups & controls HOT 1
- Support editing parameters
- Support adding/removing parameters
- OSCAL namespace URI HOT 2
- !Community Edition (CE) HOT 1
- Simplify document loading HOT 4
- Implement hoverable popover
- Resolve images not appearing within OSCAL System Security Plan Viewer
- OSCAL Builder Example
- Export error : OSCALStyle, OSCALPermanentDrawer, OSCALAppBar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oscal-react-library.