showdown.js script that maps Markdown to HTML, and we want to run it in two places:
- on the client to present a preview pane
- on the server to store the Markdown as HTML for easy presentation (as opposed to running the script against every comment dynamically)
Here’s how we can run it on the server:
To see how to inject the File into the class in Spring, see my post Injecting a file from the classpath into a bean.