English 中文(简体)
Jekyll从咖啡豆类转化器(有色灯)中逃脱产出
原标题:Jekyll escapes output from CoffeeScript converter (with Octopress)

http://octopress.org/“rel=“nofollow” 现在我想补充一些 Java文,我想在咖啡厅读写。

I followed this Gist to create a simple converter that compiles CoffeeScript to Javascript:

module Jekyll
  require  coffee-script 

  class CoffeeScriptConverter < Converter
    safe true
    priority :low

    def matches(ext)
      ext =~ /coffee/i
    end

    def output_ext(ext)
       .js 
    end

    def convert(content)
      begin
        CoffeeScript.compile content
      rescue StandardError => e
        puts "CoffeeScript error: #{e.message}"
      end
    end
  end
end

问题是, generated印文档中的所有引文均已越出(&#8216;&#8220;)。

When I output the generated Javascript code in the convert method, it looks fine (quotes are not escaped). I googled a lot but nobody seems to have this problem. What could be the issue here?

最佳回答

Turns out Octopress runs the content through RubyPants by default (see plugins/octopress_filters.rb). Disabling RubyPants did the trick!

问题回答

由于RubyPants忽视了超文本评论中的内容,我们可以通过在超文本评论中围绕产出进行过滤。 这还消除了修改八十七条新刑法的必要性。

我是在上做的。





相关问题
How do I define global variables in CoffeeScript?

On Coffeescript.org: bawbag = (x, y) -> z = (x * y) bawbag(5, 10) would compile to: var bawbag; bawbag = function(x, y) { var z; return (z = (x * y)); }; bawbag(5, 10); compiling via ...

I m trying to re-write this in CoffeeScript. Coming unstuck

function getElementsByClassName(className) { // get all elements in the document if (document.all) { var allElements = document.all; } else { var allElements = document.getElementsByTagName("...

Anonymous functions syntax in CoffeeScript

I ve been looking at CoffeeScript and I m not understanding how you would write code like this. How does it handle nested anonymous functions in its syntax? ;(function($) { var app = $....

Why are my CoffeeScript/backbone.js events not firing?

I m trying to familiarize myself with CoffeeScript and backbone.js, and I must be missing something. This CoffeeScript: MyView = Backbone.View.extend events: { "click" : "testHandler" ...

Custom compiler with maven

I m trying to make Maven2 to compile coffeescript to javascript. As far as I m concerned there is no plugin which provides compiling coffeescript. Is there a compiler-plugin for maven which can be ...

what is wrong when I compile my .coffee files

Hi there Iam using coffeeScript for my apps now and I love it but recently I ve been having a lot of trouble with compilation, Iam using it for a rails application and when I run coffee -w -c public/...

CoffeeScript on Windows?

How can I try CoffeeScript on Windows? The installation instructions are only for *nix: http://jashkenas.github.com/coffee-script/#installation EDIT: Since I asked this a while ago, many new ...

How can I compile CoffeeScript from .NET?

I want to write an HttpHandler that compiles CoffeeScript code on-the-fly and sends the resulting JavaScript code. I have tried MS [JScript][1] and IronJS without success. I don t want to use [Rhino][...