Prettify needs class="prettyprint"
to be add to <pre>
or <code>
. How to let WMD do this?
相关问题
- Can't seem to save the markup version of the t
- Stackoverflows WMD System - Where does my input be
- Using Google Prettify to display HTML
- Is there a pretty printer for python data?
- format xml, pretty print
相关文章
- Stackoverflows WMD System - Where does my input be
- Using Google Prettify to display HTML
- Is there a pretty printer for python data?
- format xml, pretty print
- How to beautify/prettify a Json/JS file in a node.
- WMD in Django Admin?
- How do you store the markdown using WMD in ASP.NET
- 白名单,防止XSS在C#WMD控制(Whitelisting, preventing XSS wit
With the help of jquery and using the timer plugin this can be done in the following way.
The mechanism of the above is described here Hope it helps.
Take a look at the PageDown Markdown editor...
AFAIK, WMD is dead, but PageDown is a fork based on the WMD source.
It's an active project based on the work done in WMD. That takes care of the Markdown editor. To get syntax highlighting working you'll also need to download source from the Google-Code-Prettify project.
Combine the demo.html, demo.css, prettify.js, prettify.css into the same folder.
Modify the imports accordingly:
Note: This assumes that the PageDown source files are in the parent directory.
To enable syntax highlighting, you'll need to do two things:
If you take a look at the code, I modified the non-sanitized converter to do both:
To give you an idea of the flexibility. Google-Code-Prettify is the same library that enables syntax highlighting on code.google.com and stackoverflow.com.
It took me a little while to figure out how to get it to work but it's amazing how easy it is to implement. This is only a demo example but it shouldn't be too hard to extend it further.
You may be interested in the Stack Overflow version of WMD on Github. This version may have the feature you're looking for in it (but I'm not certain).