arti_mark 0.1.beta2 → 0.1.beta3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/arti_mark/parser.kpeg +28 -30
- data/lib/arti_mark/parser.kpeg.rb +454 -452
- data/lib/arti_mark/version.rb +1 -1
- data/spec/arti_mark_spec.rb +15 -0
- metadata +1 -1
data/lib/arti_mark/version.rb
CHANGED
data/spec/arti_mark_spec.rb
CHANGED
@@ -565,5 +565,20 @@ describe ArtiMark do
|
|
565
565
|
]
|
566
566
|
)
|
567
567
|
end
|
568
|
+
|
569
|
+
it 'should convert h1 in article after title' do
|
570
|
+
text = "stylesheets: css/default.css\ntitle: foo\narticle.atogaki {\n\nh1: あとがき。\n\natogaki\n}"
|
571
|
+
artimark = ArtiMark::Document.new(:lang => 'ja', :title => 'the document title')
|
572
|
+
converted = artimark.convert(text)
|
573
|
+
body = Nokogiri::XML::Document.parse(converted[0]).root.at_xpath('xmlns:body')
|
574
|
+
expect(body.element_children[0].selector_and_children).to eq(
|
575
|
+
["article.atogaki",
|
576
|
+
["h1", "あとがき。"],
|
577
|
+
["div.pgroup",
|
578
|
+
["p", "atogaki"]]]
|
579
|
+
)
|
580
|
+
end
|
581
|
+
|
582
|
+
|
568
583
|
end
|
569
584
|
end
|