Permalink
Browse files

Fixing problem with level of aliased section macros

Closes #207.
  • Loading branch information...
1 parent e5409fc commit eb1d94b1b2b3d75f8de6d0079f25018fd6c5b222 @h3rald committed May 12, 2012
Showing with 26 additions and 0 deletions.
  1. +1 −0 lib/glyph/utils.rb
  2. +25 −0 spec/macros/macros_spec.rb
View
@@ -142,6 +142,7 @@ def titled_sections
(Glyph['system.structure.frontmatter']+
Glyph['system.structure.bodymatter']+
Glyph['system.structure.backmatter']+
+ Glyph.macro_aliases_for(:section)+
[:section]).uniq
end
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# encoding: UTF-8
require File.join(File.dirname(__FILE__), "..", "spec_helper")
describe "Macro:" do
@@ -188,4 +189,28 @@
Glyph['document.draft'] = false
end
+ it "Aliased section titles should be at the same level of non-aliased section titles" do
+ normal = %{
+ section[
+ @title[Title2]
+ ...
+ ]
+ }
+ aliased = %{
+ §[
+ @title[Title2]
+ ...
+ ]
+ }
+ container = lambda do |s|
+ %{
+ section[
+ @title[Title]
+ #{s}
+ ]
+ }
+ end
+ output_for(container.call aliased).should == output_for(container.call normal)
+ end
+
end

0 comments on commit eb1d94b

Please sign in to comment.