Commit 4b8c0f2f by Tom Jin Committed by Sylvester Keil

Preventing @string objects being passed to the renderer. (#170)

* Add failing test for bibtex string replacement with negative queries. * Fix entries returing non-BibTeX::Entry objects.
parent aec36c9f
......@@ -112,3 +112,30 @@ Feature: String replacement
Then the _site directory should exist
And the "_site/scholar.html" file should exist
And I should see "<i>\"The \" # \"Ruby\" # \" Programming Language\"</i>" in "_site/scholar.html"
@tags @string
Scenario: String replacement with queries involving negative conditions
Given I have a scholar configuration with:
| key | value |
| source | ./_bibliography |
And I have a "_bibliography" directory
And I have a file "_bibliography/references.bib":
"""
@string{ rubypl = "The Ruby Programming Language" }
@book{ruby,
title = rubypl,
author = {Flanagan, David and Matsumoto, Yukihiro},
year = {2008},
publisher = {O'Reilly Media}
}
"""
And I have a page "scholar.html":
"""
---
---
{% bibliography -f references --query !@article %}
"""
When I run jekyll
Then the _site directory should exist
And the "_site/scholar.html" file should exist
And I should see "<i>The Ruby Programming Language</i>" in "_site/scholar.html"
......@@ -161,7 +161,7 @@ module Jekyll
end
def entries
sort bibliography[query || config['query']]
sort bibliography[query || config['query']].select { |x| x.instance_of? BibTeX::Entry}
end
def offset
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment