Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rbenv-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.3-p392
1.9.3-p547
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--color
--format documentation
--require spec_helper
102 changes: 85 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,121 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.6)
actionpack (= 4.1.6)
actionview (= 4.1.6)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.6)
actionview (= 4.1.6)
activesupport (= 4.1.6)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
actionview (4.1.6)
activesupport (= 4.1.6)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.6)
activesupport (= 4.1.6)
builder (~> 3.1)
activerecord (4.1.6)
activemodel (= 4.1.6)
activesupport (= 4.1.6)
arel (~> 5.0.0)
activesupport (4.1.6)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
appraisal (1.0.0)
bundler
rake
thor (>= 0.14.0)
arel (5.0.1.20140414130214)
blankslate (2.1.2.4)
coveralls (0.7.0)
builder (3.2.2)
coveralls (0.7.1)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
diff-lcs (1.2.5)
docile (1.1.3)
docile (1.1.5)
erubis (2.7.0)
haml (4.0.5)
tilt
mime-types (2.2)
hike (1.2.3)
i18n (0.6.11)
json (1.8.1)
mail (2.6.1)
mime-types (>= 1.16, < 3)
mime-types (2.4.1)
minitest (5.4.2)
multi_json (1.10.1)
netrc (0.7.7)
parslet (1.6.0)
blankslate (~> 2.0)
rake (10.1.0)
rest-client (1.6.7)
mime-types (>= 1.16)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.1.6)
actionmailer (= 4.1.6)
actionpack (= 4.1.6)
actionview (= 4.1.6)
activemodel (= 4.1.6)
activerecord (= 4.1.6)
activesupport (= 4.1.6)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.6)
sprockets-rails (~> 2.0)
railties (4.1.6)
actionpack (= 4.1.6)
activesupport (= 4.1.6)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.3.2)
rest-client (1.7.2)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rspec (3.0.0)
rspec-core (~> 3.0.0)
rspec-expectations (~> 3.0.0)
rspec-mocks (~> 3.0.0)
rspec-core (3.0.0)
rspec-core (3.0.4)
rspec-support (~> 3.0.0)
rspec-expectations (3.0.0)
rspec-expectations (3.0.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-mocks (3.0.0)
rspec-mocks (3.0.4)
rspec-support (~> 3.0.0)
rspec-support (3.0.0)
simplecov (0.8.2)
rspec-support (3.0.4)
simplecov (0.9.1)
docile (~> 1.1.0)
multi_json
multi_json (~> 1.0)
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slim (2.0.2)
slim (2.0.3)
temple (~> 0.6.6)
tilt (>= 1.3.3, < 2.1)
temple (0.6.7)
sprockets (2.12.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.2.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
temple (0.6.8)
term-ansicolor (1.3.0)
tins (~> 1.0)
thor (0.18.1)
tilt (2.0.1)
tins (1.3.0)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
tins (1.3.3)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby
Expand All @@ -64,6 +131,7 @@ DEPENDENCIES
bundler (~> 1.3)
coveralls
haml (~> 4.0)
rails (~> 4.0)
rake
rspec (~> 3.0.0)
shortcode!
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Shortcode.setup do |config|
config.self_closing_tags = [:youtube]

# the type of quotes to use for attribute values, default is double quotes (")
config.attribute_quote_type = '"'
config.attribute_quote_type = /[\"']/

# Allows quotes around attributes to be omitted
# Defaults to true, quotes must be present around attribute values
Expand Down
2 changes: 1 addition & 1 deletion lib/shortcode/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def initialize
@helpers = []
@block_tags = []
@self_closing_tags = []
@attribute_quote_type = '"'
@attribute_quote_type = /\"/
@use_attribute_quotes = true
end
end
2 changes: 1 addition & 1 deletion lib/shortcode/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Shortcode::Parser < Parslet::Parser
rule(:block_tag) { match_any_of Shortcode.configuration.block_tags }
rule(:self_closing_tag) { match_any_of Shortcode.configuration.self_closing_tags }

rule(:quotes) { str(Shortcode.configuration.attribute_quote_type) }
rule(:quotes) { match(Shortcode.configuration.attribute_quote_type) }

rule(:space) { str(' ').repeat(1) }
rule(:space?) { space.maybe }
Expand Down
3 changes: 3 additions & 0 deletions shortcode.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "coveralls"
spec.add_development_dependency "slim", "~> 2.0"
spec.add_development_dependency "haml", "~> 4.0"

# Need rails for tests
spec.add_development_dependency "rails", "~> 4.0"
end
2 changes: 1 addition & 1 deletion spec/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

before do
Shortcode.setup do |config|
config.attribute_quote_type = "'"
config.attribute_quote_type = /'/
end
end

Expand Down