Closed WillsB3 closed 11 years ago
The cause of this problem is that Jekyll Picture Tag is (quite reasonably) generating an img
tag that isn’t self-closing, and so when reading_time tries to use an XML parser to look at your page’s source the parser barfs. I suspect the best solution will be to switch from REXML to a more forgiving, Beautiful Soup–like HTML parser. I’ll look into it.
Great :+1:
Fixed in 1.1.0.
Hi,
I'm trying to use this plugin in conjunction with Jekyll Picture Tag. I've got the picture tag plugin setup and working fine, but when I added this plugin I get errors in the console and the reading time isn't rendered.
Here's a sample error from my console:
Liquid Exception: #<REXML::ParseException: Missing end tag for 'img' (got "noscript") Line: 27 Position: 4365 Last 80 unconsumed characters: > /Users/Wills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:335:in
pull_event' /Users/Wills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:183:inpull' /Users/Wills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:22:in
parse' /Users/Wills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/rexml/document.rb:245:inbuild' /Users/Wills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/rexml/document.rb:43:in
initialize' /Users/Wills/Sites/Projects/Personal/Rather Semantic - Jekyll/_plugins/reading_time.rb:30:innew' /Users/Wills/Sites/Projects/Personal/Rather Semantic - Jekyll/_plugins/reading_time.rb:30:in
words' /Users/Wills/Sites/Projects/Personal/Rather Semantic - Jekyll/_plugins/reading_time.rb:7:incount_words' /Users/Wills/Sites/Projects/Personal/Rather Semantic - Jekyll/_plugins/reading_time.rb:11:in
reading_time' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/strainer.rb:43:ininvoke' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/context.rb:75:in
invoke' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/variable.rb:50:inblock in render' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/variable.rb:38:in
each' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/variable.rb:38:ininject' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/variable.rb:38:in
render' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/block.rb:106:inblock in render_all' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/block.rb:93:in
each' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/block.rb:93:inrender_all' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/block.rb:82:in
render' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/template.rb:124:inrender' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/liquid-2.5.1/lib/liquid/template.rb:132:in
render!' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/convertible.rb:81:inrender_liquid' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/convertible.rb:102:in
render_all_layouts' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/convertible.rb:137:indo_layout' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/post.rb:260:in
render' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/site.rb:213:inblock in render' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/site.rb:212:in
each' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/site.rb:212:inrender' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/site.rb:44:in
process' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/command.rb:18:inprocess_site' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/jekyll-1.1.2/lib/jekyll/commands/build.rb:47:in
block in watch' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:580:incall' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:580:in
block in notify_observers' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:579:ineach' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:579:in
notify_observers' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:334:inblock in initialize' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:224:in
call' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:224:innotify' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:102:in
run_once' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:150:inrun_loop' /Users/Wills/.rvm/gems/ruby-1.9.3-p448@rathersemantic/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:45:in
block in start' ... Missing end tag for 'img' (got "noscript") Line: 27 Position: 4365 Last 80 unconsumed characters: Line: 27 Position: 4365 Last 80 unconsumed characters: in post.html`I've run my generated pages markup through HTML5 Validator and I get no relevant warnings or errors.
P.S - Apologies for the crazy single-line paste, but I'm not sure how else to format the error!