jekyll-org icon indicating copy to clipboard operation
jekyll-org copied to clipboard

Title of an *.org file is incorrectly parsed if it contains the string `yes`, `no`, `true`, `false`, etc

Open taquangtrung opened this issue 4 years ago • 0 comments

Hi,

As described in the title of this issue, I believe it is caused by this code segment in the module converter.rb.

      @@truthy_regexps = [/enabled/,  /yes/, /true/]
      @@falsy_regexps  = [/disabled/, /no/,  /false/]

      def _parse_boolean(value, error_msg=nil)
        case value.downcase
        when *@@truthy_regexps
          true
        when *@@falsy_regexps
          false
        else
          unless error_msg.nil?
            Jekyll.logger.warn("OrgDocument:", error_msg + ": #{value}")
          end
        end
      end

Here is the title in my org file:

#+TITLE: Yes
#+LAYOUT: page

Here is the log generated by Jekyll:

/var/lib/gems/2.7.0/gems/jekyll-org-1.1.1/lib/jekyll-org.rb:44: warning: Using the last argument as keyword parameters is deprecated
       Jekyll Feed: Generating feed for posts
  Liquid Exception: undefined method `gsub' for true:TrueClass in /_layouts/default.html
             Error: undefined method `gsub' for true:TrueClass
             Error: Run jekyll build --trace for more information.
                    
      Regenerating: 2 file(s) changed at 2020-07-25 19:51:21
                    private/research/projects/discover/alias-analysis/notes-on-alias-analysis.org
                    private/research/projects/discover/alias-analysis/.#notes-on-alias-analysis.org

taquangtrung avatar Jul 25 '20 11:07 taquangtrung