upflow
upflow copied to clipboard
Custom converter on initialization
upflow.attach(
document.getElementById("canvas"),
document.getElementById("content"),
my_converter);
I want to set up my own converter on initialization.
Now I can do it by upflow.showdown = my_converter
, but it will override converter for all instances of upflow. This is not good in case which is contain two different converters in one page (for example, Markdown and Textile).
I've tried patch upflow by myself with no luck. It was harder than I thought.
I'm afraid that's probably going to be slightly more difficult than that. Even if the library was changed to make filters a property of canvas, rather than a global, there are other places where upflow assumes that it's working with markdown. Such as upflow.parseToTokens
and upflow.roundTrip
.
That said, I think it could be done with some refactoring. Do you have a javascript implementation of textile at hand?
http://jrm.cc/extras/live-textile-preview.php