Skip to content

addresses #125. inline code dark background #134

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

Merged
merged 1 commit into from
Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web-app/src/components/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Markdown = (props: Props) => {
</div>`
}
// TODO sanitize markdown or HTML
return <div dangerouslySetInnerHTML={{ __html: html }} />
return <span className="coderoad-markdown" dangerouslySetInnerHTML={{ __html: html }} />
}

export default Markdown
3 changes: 3 additions & 0 deletions web-app/src/components/Markdown/prism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ import 'prismjs/components/prism-typescript'
import 'prismjs/themes/prism-tomorrow.css'

// TODO import all - current list only supports js related

// resolve unsupported style cases
import './style.css'
6 changes: 6 additions & 0 deletions web-app/src/components/Markdown/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.coderoad-markdown :not(pre) > code {
background-color: black;
color: white;
border-radius: 2px;
padding: 0.1rem;
}
3 changes: 3 additions & 0 deletions web-app/stories/Step.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const stepText =
'This is a long paragraph of step text intended to wrap around the side after a short period of writing to demonstrate text wrap among other things'

const paragraphText = `Markdown included \`code\`, *bold*, & _italics_.
Inline code: \`<h1>HTML</h1>\`, \`function someFunc() { var a = 1; return a; }\`
\`\`\`javascript
var a = 12
Expand Down