Skip to content

Commit d9e5d45

Browse files
authored
Merge pull request #134 from ShMcK/feature/dark-code-block
addresses #125. inline code dark background
2 parents 3f68df6 + 9807c2e commit d9e5d45

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

web-app/src/components/Markdown/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const Markdown = (props: Props) => {
6666
</div>`
6767
}
6868
// TODO sanitize markdown or HTML
69-
return <div dangerouslySetInnerHTML={{ __html: html }} />
69+
return <span className="coderoad-markdown" dangerouslySetInnerHTML={{ __html: html }} />
7070
}
7171

7272
export default Markdown

web-app/src/components/Markdown/prism.ts

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ import 'prismjs/components/prism-typescript'
1111
import 'prismjs/themes/prism-tomorrow.css'
1212

1313
// TODO import all - current list only supports js related
14+
15+
// resolve unsupported style cases
16+
import './style.css'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.coderoad-markdown :not(pre) > code {
2+
background-color: black;
3+
color: white;
4+
border-radius: 2px;
5+
padding: 0.1rem;
6+
}

web-app/stories/Step.stories.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const stepText =
99
'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'
1010

1111
const paragraphText = `Markdown included \`code\`, *bold*, & _italics_.
12+
13+
Inline code: \`<h1>HTML</h1>\`, \`function someFunc() { var a = 1; return a; }\`
14+
1215
\`\`\`javascript
1316
var a = 12
1417

0 commit comments

Comments
 (0)