https://github.com/chjj/marked
On Sunday, March 4, 2012 8:19:29 AM UTC-6, Paul wrote:
That's the only solution I was able to find, too, though in my case I made it a view helper and called it from the view:app.helpers({ md : function(text){return ghm.parse(text);}});div != md(content.body)On Sun, Mar 4, 2012 at 9:00 AM, Brandon Martin<bma...@zyphmartin.com> wrote:Sorry I was trying to make it more generic then what I am doing and had some typos. Let's try this again:ghm = require("github-flavored-markdown"); exports.about = function(req, res) {Content.findOne({}, function(err, content) {content.body = ghm.parse(content.body);res.render('about/index', {content: content,});});};Then in about/index.jadediv !{content.body}On Sun, Mar 4, 2012 at 5:50 AM, Brandon Martin<bma...@zyphmartin.com> wrote:Sorry hit send by accident. Then in the view just diddiv !{mission.body}On Sun, Mar 4, 2012 at 5:48 AM, Brandon Martin<bma...@zyphmartin.com> wrote:I had a similar issue before. I used github-flavored-markdown and parsed the markdown before handing off to the view. ie:ghm = require("github-flavored-markdown"); exports.mission = function(req, res) {Content.findOne({}, function(err, content) {content.body = ghm.parse(content.body);res.render('about/index', {content: content,});});};Then in index.jadeWere just trying the same thing.What are your suggested approach to this?I've got the markdown-js packageThanks!
On Sunday, February 5, 2012 5:11:38 PM UTC+1, vision media [ Tj Holowaychuk ] wrote:filters are compile-time, they can't have access to vars since they're only compiled onceOn Sun, Feb 5, 2012 at 7:56 AM, Geert Pasteels wrote:How can I pass a variable to the markdown filter?I tried:markdown#{description}:markdown=descriptionBut none seem to be working.
댓글 없음:
댓글 쓰기