Comments (3)
The default configuration doesn't do any syntax highlighting or styling. This means it's up to the implementer to choose how things should look.
Blockquotes can be easily styled. The demo uses the following CSS, for instance:
blockquote {
color: #666;
margin: 0;
padding-left: 3em;
border-left: 0.5em #eee solid;
}
The demo uses highlight.js for syntax highlighting through a custom renderer.
See demo/src/code-block.js for how that works, and demo/src/demo.js for how to enable the renderer.
Of course, this approach relies on hljs being loaded into the DOM already.
I also have a repository called react-markdown-examples which includes a better (though more complicated) example of syntax highlighting, using react-lowlight.
from react-markdown.
Thanks for the comments here. Was looking for the same thing. It might make sense to include a note about the examples repo in the main README.
from react-markdown.
If it helps anyone who comes here later, if you're using bootstrap, it'll automatically help style it.
from react-markdown.
Related Issues (20)
- Unnecessarily narrow range for React peer deps HOT 7
- Support for inapp links HOT 5
- text not created as hyperlink HOT 6
- Possible inconsistency with handling emphasis and strong when immediately followed by emphasis HOT 3
- p component overriding img component HOT 4
- A 11k star makrdown widget can not have a copy button at code block?
- How render image in cneter? HOT 3
- rermarkgfm showing tasklist wrong HOT 21
- \n Doesn't work properly HOT 8
- Tables do not display correctly when they have spaces at the beginning (remark-gfm) HOT 2
- Code is wrapped in an exrea <pre> even with a custom component HOT 9
- Custom Components Always Re-rendered HOT 4
- Not compatible to Chrome 90 or older HOT 9
- How to append content ,not cover? HOT 2
- When using two **enclosed bold texts containing colons, react-markdown fails to correctly parse the bold syntax. HOT 3
- Please add syntax for `{.tabset} ` HOT 2
- Typescript error while using syntax hightlight part code from README.md HOT 4
- sup element rendering with remark-gfm plugin is painfully slow. HOT 7
- React 18.3.0/19.0.0 support for react-markdown ^6.0.0 HOT 2
- React-markdown isn't rendering phone number links anymore HOT 3
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 react-markdown.