diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2014-02-16 01:39:51 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2014-02-16 01:43:21 -0700 |
| commit | d2fc99182cfa635dc25aecee83b93a22338bedab (patch) | |
| tree | 364e4a37b95ab20881f6fcaf5a7d908adafa0eb4 | |
| parent | 16b64087bc066b99e33976ed4901ec83bb3bbbb1 (diff) | |
call each thing by its right name
- rename Lexer to Parser
- use dot notation instead of double colon notation for class methods
| -rw-r--r-- | Rakefile | 2 | ||||
| -rw-r--r-- | lib/asciidoctor.rb | 2 | ||||
| -rw-r--r-- | lib/asciidoctor/abstract_node.rb | 4 | ||||
| -rw-r--r-- | lib/asciidoctor/cli/options.rb | 2 | ||||
| -rw-r--r-- | lib/asciidoctor/document.rb | 2 | ||||
| -rw-r--r-- | lib/asciidoctor/extensions.rb | 2 | ||||
| -rw-r--r-- | lib/asciidoctor/parser.rb (renamed from lib/asciidoctor/lexer.rb) | 32 | ||||
| -rw-r--r-- | lib/asciidoctor/reader.rb | 2 | ||||
| -rw-r--r-- | lib/asciidoctor/substitutors.rb | 2 | ||||
| -rw-r--r-- | test/document_test.rb | 24 | ||||
| -rw-r--r-- | test/invoker_test.rb | 46 | ||||
| -rw-r--r-- | test/parser_test.rb (renamed from test/lexer_test.rb) | 40 | ||||
| -rw-r--r-- | test/test_helper.rb | 2 | ||||
| -rw-r--r-- | test/text_test.rb | 4 |
14 files changed, 83 insertions, 83 deletions
@@ -22,7 +22,7 @@ rescue LoadError end =begin -# Run tests with Encoding::default_external set to US-ASCII +# Run tests with Encoding.default_external set to US-ASCII begin Rake::TestTask.new(:test_us_ascii) do |test| prepare_test_env diff --git a/lib/asciidoctor.rb b/lib/asciidoctor.rb index bbe07d95..5e6880bf 100644 --- a/lib/asciidoctor.rb +++ b/lib/asciidoctor.rb @@ -1458,8 +1458,8 @@ module Asciidoctor require 'asciidoctor/callouts' require 'asciidoctor/document' require 'asciidoctor/inline' - require 'asciidoctor/lexer' require 'asciidoctor/list' + require 'asciidoctor/parser' require 'asciidoctor/path_resolver' require 'asciidoctor/reader' require 'asciidoctor/renderer' diff --git a/lib/asciidoctor/abstract_node.rb b/lib/asciidoctor/abstract_node.rb index 3219ccb1..d3fc6b9a 100644 --- a/lib/asciidoctor/abstract_node.rb +++ b/lib/asciidoctor/abstract_node.rb @@ -378,7 +378,7 @@ class AbstractNode # Public: Normalize the web page using the PathResolver. # - # See PathResolver::web_path(target, start) for details. + # See {PathResolver.web_path} for details. # # target - the String target path # start - the String start (i.e, parent) path (optional, default: nil) @@ -391,7 +391,7 @@ class AbstractNode # Public: Resolve and normalize a secure path from the target and start paths # using the PathResolver. # - # See PathResolver::system_path(target, start, jail, opts) for details. + # See {PathResolver.system_path} for details. # # The most important functionality in this method is to prevent resolving a # path outside of the jail (which defaults to the directory of the source diff --git a/lib/asciidoctor/cli/options.rb b/lib/asciidoctor/cli/options.rb index 84118a83..ce5d857a 100644 --- a/lib/asciidoctor/cli/options.rb +++ b/lib/asciidoctor/cli/options.rb @@ -110,7 +110,7 @@ Example: asciidoctor -b html5 source.asciidoc self[:destination_dir] = dest_dir end opts.on('-r', '--require LIBRARY', ::Array, - 'require the specified library before executing the processor (calls Kernel::require)', + 'require the specified library before executing the processor (calls Kernel.require)', 'may be specified more than once') do |paths| self[:requires] = paths end diff --git a/lib/asciidoctor/document.rb b/lib/asciidoctor/document.rb index 55449a8a..90bff434 100644 --- a/lib/asciidoctor/document.rb +++ b/lib/asciidoctor/document.rb @@ -352,7 +352,7 @@ class Document < AbstractBlock end # Now parse the lines in the reader into blocks - Lexer.parse @reader, self, :header_only => !!options[:parse_header_only] + Parser.parse @reader, self, :header_only => !!options[:parse_header_only] @callouts.rewind diff --git a/lib/asciidoctor/extensions.rb b/lib/asciidoctor/extensions.rb index d76504b6..0f00b417 100644 --- a/lib/asciidoctor/extensions.rb +++ b/lib/asciidoctor/extensions.rb @@ -109,7 +109,7 @@ module Extensions def parse_content parent, content, attributes = {} reader = (content.is_a? Reader) ? reader : (Reader.new content) while reader.has_more_lines? - block = Lexer.next_block(reader, parent, attributes) + block = Parser.next_block(reader, parent, attributes) parent << block if block end nil diff --git a/lib/asciidoctor/lexer.rb b/lib/asciidoctor/parser.rb index 151a40d6..2e3bda24 100644 --- a/lib/asciidoctor/lexer.rb +++ b/lib/asciidoctor/parser.rb @@ -1,11 +1,11 @@ module Asciidoctor # Public: Methods to parse lines of AsciiDoc into an object hierarchy # representing the structure of the document. All methods are class methods and -# should be invoked from the Lexer class. The main entry point is ::next_block. -# No Lexer instances shall be discovered running around. (Any attempt to -# instantiate a Lexer will be futile). +# should be invoked from the Parser class. The main entry point is ::next_block. +# No Parser instances shall be discovered running around. (Any attempt to +# instantiate a Parser will be futile). # -# The object hierarchy created by the Lexer consists of zero or more Section +# The object hierarchy created by the Parser consists of zero or more Section # and Block objects. Section objects may be nested and a Section object # contains zero or more Block objects. Block objects may be nested, but may # only contain other Block objects. Block objects which represent lists may @@ -14,18 +14,18 @@ module Asciidoctor # Examples # # # Create a Reader for the AsciiDoc lines and retrieve the next block from it. -# # Lexer::next_block requires a parent, so we begin by instantiating an empty Document. +# # Parser.next_block requires a parent, so we begin by instantiating an empty Document. # # doc = Document.new # reader = Reader.new lines -# block = Lexer.next_block(reader, doc) +# block = Parser.next_block(reader, doc) # block.class # # => Asciidoctor::Block -class Lexer +class Parser BlockMatchData = Struct.new :context, :masq, :tip, :terminator - # Public: Make sure the Lexer object doesn't get initialized. + # Public: Make sure the Parser object doesn't get initialized. # # Raises RuntimeError if this constructor is invoked. def initialize @@ -34,7 +34,7 @@ class Lexer # Public: Parses AsciiDoc source read from the Reader into the Document # - # This method is the main entry-point into the Lexer when parsing a full document. + # This method is the main entry-point into the Parser when parsing a full document. # It first looks for and, if found, processes the document title. It then # proceeds to iterate through the lines in the Reader, parsing the document # into nested Sections and Blocks. @@ -204,10 +204,10 @@ class Lexer # # and hold attributes extracted from header # doc = Document.new # - # Lexer.next_section(reader, doc).first.title + # Parser.next_section(reader, doc).first.title # # => "Greetings" # - # Lexer.next_section(reader, doc).first.title + # Parser.next_section(reader, doc).first.title # # => "Salutations" # # returns a two-element Array containing the Section and Hash of orphaned attributes @@ -1103,7 +1103,7 @@ class Lexer # Public: Parse blocks from this reader until there are no more lines. # - # This method calls Lexer#next_block until there are no more lines in the + # This method calls Parser#next_block until there are no more lines in the # Reader. It does not consider sections because it's assumed the Reader only # has lines which are within a delimited block region. # @@ -1113,7 +1113,7 @@ class Lexer # Returns nothing. def self.parse_blocks(reader, parent) while reader.has_more_lines? - block = Lexer.next_block(reader, parent) + block = Parser.next_block(reader, parent) parent << block if block end end @@ -2138,7 +2138,7 @@ class Lexer # Examples # # marker = 'B.' - # Lexer::resolve_ordered_list_marker(marker, 1, true) + # Parser.resolve_ordered_list_marker(marker, 1, true) # # => 'A.' # # Returns the String of the first marker in this number series @@ -2571,10 +2571,10 @@ class Lexer # source.split("\n") # # => [" def names", " @names.split ' '", " end"] # - # Lexer.reset_block_indent(source.split "\n") + # Parser.reset_block_indent(source.split "\n") # # => ["def names", " @names.split ' '", "end"] # - # puts Lexer.reset_block_indent(source.split "\n") * "\n" + # puts Parser.reset_block_indent(source.split "\n") * "\n" # # => def names # # => @names.split ' ' # # => end diff --git a/lib/asciidoctor/reader.rb b/lib/asciidoctor/reader.rb index 50f606de..31ce1193 100644 --- a/lib/asciidoctor/reader.rb +++ b/lib/asciidoctor/reader.rb @@ -579,7 +579,7 @@ class PreprocessorReader < Reader end if (indent = opts.fetch(:indent, nil)) - Lexer.reset_block_indent! result, indent.to_i + Parser.reset_block_indent! result, indent.to_i end result diff --git a/lib/asciidoctor/substitutors.rb b/lib/asciidoctor/substitutors.rb index 817adbb3..23bbc184 100644 --- a/lib/asciidoctor/substitutors.rb +++ b/lib/asciidoctor/substitutors.rb @@ -373,7 +373,7 @@ module Substitutors case directive when 'set' args = expr.split(':') - _, value = Lexer::store_attribute(args[0], args[1] || '', @document) + _, value = Parser.store_attribute(args[0], args[1] || '', @document) unless value # since this is an assignment, only drop-line applies here (skip and drop imply the same result) if @document.attributes.fetch('attribute-undefined', Compliance.attribute_undefined) == 'drop-line' diff --git a/test/document_test.rb b/test/document_test.rb index 4cd159e8..a08b3d45 100644 --- a/test/document_test.rb +++ b/test/document_test.rb @@ -362,7 +362,7 @@ text assert_xpath '/html/head/title[text() = "Document Title"]', output, 1 assert_xpath '/html/body/*[@id="header"]/h1[text() = "Document Title"]', output, 1 ensure - FileUtils::rm(sample_output_path) + FileUtils.rm(sample_output_path) end end @@ -380,7 +380,7 @@ text assert_xpath '/html/head/title[text() = "Document Title"]', output, 1 assert_xpath '/html/body/*[@id="header"]/h1[text() = "Document Title"]', output, 1 ensure - FileUtils::rm(sample_output_path) + FileUtils.rm(sample_output_path) end end @@ -401,7 +401,7 @@ text rescue => e flunk e.message ensure - FileUtils::rm(sample_output_path, :force => true) + FileUtils.rm(sample_output_path, :force => true) end end @@ -412,7 +412,7 @@ text begin Asciidoctor.render_file(sample_input_path, :to_file => sample_output_path, :in_place => true) ensure - FileUtils::rm(sample_output_path) if File.exist? sample_output_path + FileUtils.rm(sample_output_path) if File.exist? sample_output_path end end end @@ -424,7 +424,7 @@ text begin Asciidoctor.render_file(sample_input_path, :to_dir => '', :in_place => true) ensure - FileUtils::rm(sample_output_path) if File.exist? sample_output_path + FileUtils.rm(sample_output_path) if File.exist? sample_output_path end end end @@ -438,8 +438,8 @@ text Asciidoctor.render_file(sample_input_path, :to_dir => output_dir) assert File.exist? sample_output_path ensure - FileUtils::rm(sample_output_path) if File.exist? sample_output_path - FileUtils::rmdir output_dir + FileUtils.rm(sample_output_path) if File.exist? sample_output_path + FileUtils.rmdir output_dir end end @@ -451,9 +451,9 @@ text Asciidoctor.render_file(sample_input_path, :to_dir => output_dir, :mkdirs => true) assert File.exist? sample_output_path ensure - FileUtils::rm(sample_output_path) if File.exist? sample_output_path - FileUtils::rmdir output_dir - FileUtils::rmdir File.dirname(output_dir) + FileUtils.rm(sample_output_path) if File.exist? sample_output_path + FileUtils.rmdir output_dir + FileUtils.rmdir File.dirname(output_dir) end end @@ -468,8 +468,8 @@ text Asciidoctor.render_file(sample_input_path, :to_dir => base_dir, :to_file => sample_rel_output_path) assert File.exist? sample_output_path ensure - FileUtils::rm(sample_output_path) if File.exist? sample_output_path - FileUtils::rmdir output_dir + FileUtils.rm(sample_output_path) if File.exist? sample_output_path + FileUtils.rmdir output_dir end end end diff --git a/test/invoker_test.rb b/test/invoker_test.rb index e7577ed0..8ed52231 100644 --- a/test/invoker_test.rb +++ b/test/invoker_test.rb @@ -76,7 +76,7 @@ context 'Invoker' do assert_equal sample_outpath, doc.attr('outfile') assert File.exist?(sample_outpath) ensure - FileUtils::rm_f(sample_outpath) + FileUtils.rm_f(sample_outpath) end end @@ -162,7 +162,7 @@ context 'Invoker' do assert_xpath '/html/head/title[text() = "Document Title"]', output, 1 assert_xpath '/html/body/*[@id="header"]/h1[text() = "Document Title"]', output, 1 ensure - FileUtils::rm_f(sample_outpath) + FileUtils.rm_f(sample_outpath) end end @@ -170,7 +170,7 @@ context 'Invoker' do destination_path = File.expand_path(File.join(File.dirname(__FILE__), 'test_output')) sample_outpath = File.join(destination_path, 'sample.html') begin - FileUtils::mkdir_p(destination_path) + FileUtils.mkdir_p(destination_path) # QUESTION should -D be relative to working directory or source directory? invoker = invoke_cli %w(-D test/test_output) #invoker = invoke_cli %w(-D ../../test/test_output) @@ -178,8 +178,8 @@ context 'Invoker' do assert_equal sample_outpath, doc.attr('outfile') assert File.exist?(sample_outpath) ensure - FileUtils::rm_f(sample_outpath) - FileUtils::rmdir(destination_path) + FileUtils.rm_f(sample_outpath) + FileUtils.rmdir(destination_path) end end @@ -191,7 +191,7 @@ context 'Invoker' do assert_equal sample_outpath, doc.attr('outfile') assert File.exist?(sample_outpath) ensure - FileUtils::rm_f(sample_outpath) + FileUtils.rm_f(sample_outpath) end end @@ -206,9 +206,9 @@ context 'Invoker' do assert File.exist?(asciidoctor_stylesheet) assert File.exist?(coderay_stylesheet) ensure - FileUtils::rm_f(sample_outpath) - FileUtils::rm_f(asciidoctor_stylesheet) - FileUtils::rm_f(coderay_stylesheet) + FileUtils.rm_f(sample_outpath) + FileUtils.rm_f(asciidoctor_stylesheet) + FileUtils.rm_f(coderay_stylesheet) end end @@ -221,8 +221,8 @@ context 'Invoker' do assert File.exist?(sample_outpath) assert !File.exist?(default_stylesheet) ensure - FileUtils::rm_f(sample_outpath) - FileUtils::rm_f(default_stylesheet) + FileUtils.rm_f(sample_outpath) + FileUtils.rm_f(default_stylesheet) end end @@ -237,10 +237,10 @@ context 'Invoker' do assert File.exist?(sample_outpath) assert File.exist?(custom_stylesheet) ensure - FileUtils::rm_f(sample_outpath) - FileUtils::rm_f(custom_stylesheet) - FileUtils::rmdir(stylesdir) - FileUtils::rmdir(destdir) + FileUtils.rm_f(sample_outpath) + FileUtils.rm_f(custom_stylesheet) + FileUtils.rmdir(stylesdir) + FileUtils.rmdir(destdir) end end @@ -255,10 +255,10 @@ context 'Invoker' do assert File.exist?(sample_outpath) assert !File.exist?(custom_stylesheet) ensure - FileUtils::rm_f(sample_outpath) - FileUtils::rm_f(custom_stylesheet) - FileUtils::rmdir(stylesdir) if File.directory? stylesdir - FileUtils::rmdir(destdir) + FileUtils.rm_f(sample_outpath) + FileUtils.rm_f(custom_stylesheet) + FileUtils.rmdir(stylesdir) if File.directory? stylesdir + FileUtils.rmdir(destdir) end end @@ -270,8 +270,8 @@ context 'Invoker' do assert File.exist?(basic_outpath) assert File.exist?(sample_outpath) ensure - FileUtils::rm_f(basic_outpath) - FileUtils::rm_f(sample_outpath) + FileUtils.rm_f(basic_outpath) + FileUtils.rm_f(sample_outpath) end end @@ -281,7 +281,7 @@ context 'Invoker' do invoke_cli_to_buffer %w(), "ba*.asciidoc" assert File.exist?(basic_outpath) ensure - FileUtils::rm_f(basic_outpath) + FileUtils.rm_f(basic_outpath) end end @@ -297,7 +297,7 @@ context 'Invoker' do invoke_cli_to_buffer %w(), glob assert File.exist?(basic_outpath) ensure - FileUtils::rm_f(basic_outpath) + FileUtils.rm_f(basic_outpath) end end diff --git a/test/lexer_test.rb b/test/parser_test.rb index 81a6975a..402287f3 100644 --- a/test/lexer_test.rb +++ b/test/parser_test.rb @@ -4,17 +4,17 @@ unless defined? ASCIIDOCTOR_PROJECT_DIR require 'test_helper' end -context "Lexer" do +context "Parser" do test "is_section_title?" do - assert Asciidoctor::Lexer.is_section_title?('AsciiDoc Home Page', '==================') - assert Asciidoctor::Lexer.is_section_title?('=== AsciiDoc Home Page') + assert Asciidoctor::Parser.is_section_title?('AsciiDoc Home Page', '==================') + assert Asciidoctor::Parser.is_section_title?('=== AsciiDoc Home Page') end test 'sanitize attribute name' do - assert_equal 'foobar', Asciidoctor::Lexer.sanitize_attribute_name("Foo Bar") - assert_equal 'foo', Asciidoctor::Lexer.sanitize_attribute_name("foo") - assert_equal 'foo3-bar', Asciidoctor::Lexer.sanitize_attribute_name("Foo 3^ # - Bar[") + assert_equal 'foobar', Asciidoctor::Parser.sanitize_attribute_name("Foo Bar") + assert_equal 'foo', Asciidoctor::Parser.sanitize_attribute_name("foo") + assert_equal 'foo3-bar', Asciidoctor::Parser.sanitize_attribute_name("Foo 3^ # - Bar[") end test "collect unnamed attribute" do @@ -202,7 +202,7 @@ context "Lexer" do test 'parse style attribute with id and role' do attributes = {1 => 'style#id.role'} - style, original_style = Asciidoctor::Lexer.parse_style_attribute(attributes) + style, original_style = Asciidoctor::Parser.parse_style_attribute(attributes) assert_equal 'style', style assert_nil original_style assert_equal 'style', attributes['style'] @@ -213,7 +213,7 @@ context "Lexer" do test 'parse style attribute with style, role, id and option' do attributes = {1 => 'style.role#id%fragment'} - style, original_style = Asciidoctor::Lexer.parse_style_attribute(attributes) + style, original_style = Asciidoctor::Parser.parse_style_attribute(attributes) assert_equal 'style', style assert_nil original_style assert_equal 'style', attributes['style'] @@ -226,7 +226,7 @@ context "Lexer" do test 'parse style attribute with style, id and multiple roles' do attributes = {1 => 'style#id.role1.role2'} - style, original_style = Asciidoctor::Lexer.parse_style_attribute(attributes) + style, original_style = Asciidoctor::Parser.parse_style_attribute(attributes) assert_equal 'style', style assert_nil original_style assert_equal 'style', attributes['style'] @@ -237,7 +237,7 @@ context "Lexer" do test 'parse style attribute with style, multiple roles and id' do attributes = {1 => 'style.role1.role2#id'} - style, original_style = Asciidoctor::Lexer.parse_style_attribute(attributes) + style, original_style = Asciidoctor::Parser.parse_style_attribute(attributes) assert_equal 'style', style assert_nil original_style assert_equal 'style', attributes['style'] @@ -248,7 +248,7 @@ context "Lexer" do test 'parse style attribute with positional and original style' do attributes = {1 => 'new_style', 'style' => 'original_style'} - style, original_style = Asciidoctor::Lexer.parse_style_attribute(attributes) + style, original_style = Asciidoctor::Parser.parse_style_attribute(attributes) assert_equal 'new_style', style assert_equal 'original_style', original_style assert_equal 'new_style', attributes['style'] @@ -257,7 +257,7 @@ context "Lexer" do test 'parse style attribute with id and role only' do attributes = {1 => '#id.role'} - style, original_style = Asciidoctor::Lexer.parse_style_attribute(attributes) + style, original_style = Asciidoctor::Parser.parse_style_attribute(attributes) assert_nil style assert_nil original_style assert_equal 'id', attributes['id'] @@ -267,7 +267,7 @@ context "Lexer" do test 'parse empty style attribute' do attributes = {1 => nil} - style, original_style = Asciidoctor::Lexer.parse_style_attribute(attributes) + style, original_style = Asciidoctor::Parser.parse_style_attribute(attributes) assert_nil style assert_nil original_style assert_nil attributes['id'] @@ -277,7 +277,7 @@ context "Lexer" do test 'parse style attribute with option should preserve existing options' do attributes = {1 => '%header', 'options' => 'footer', 'footer-option' => ''} - style, original_style = Asciidoctor::Lexer.parse_style_attribute(attributes) + style, original_style = Asciidoctor::Parser.parse_style_attribute(attributes) assert_nil style assert_nil original_style assert_equal 'header,footer', attributes['options'] @@ -548,7 +548,7 @@ v0.0.7, 2013-12-18 test "attribute entry overrides generated author initials" do blankdoc = Asciidoctor::Document.new reader = Asciidoctor::Reader.new "Stuart Rackham <founder@asciidoc.org>\n:Author Initials: SJR".lines.entries - metadata = Asciidoctor::Lexer.parse_header_metadata(reader, blankdoc) + metadata = Asciidoctor::Parser.parse_header_metadata(reader, blankdoc) assert_equal 'SR', metadata['authorinitials'] assert_equal 'SJR', blankdoc.attributes['authorinitials'] end @@ -571,7 +571,7 @@ end EOS lines = input.split("\n") - Asciidoctor::Lexer.reset_block_indent! lines + Asciidoctor::Parser.reset_block_indent! lines assert_equal expected, (lines * "\n") end @@ -593,7 +593,7 @@ end EOS lines = input.split("\n") - Asciidoctor::Lexer.reset_block_indent! lines + Asciidoctor::Parser.reset_block_indent! lines assert_equal expected, (lines * "\n") end @@ -615,7 +615,7 @@ end EOS lines = input.split("\n") - Asciidoctor::Lexer.reset_block_indent! lines, 2 + Asciidoctor::Parser.reset_block_indent! lines, 2 assert_equal expected, (lines * "\n") end @@ -631,7 +631,7 @@ end expected = input lines = input.lines.entries - Asciidoctor::Lexer.reset_block_indent! lines, nil + Asciidoctor::Parser.reset_block_indent! lines, nil assert_equal expected, lines.join end @@ -640,7 +640,7 @@ end expected = input lines = input.dup - Asciidoctor::Lexer.reset_block_indent! lines + Asciidoctor::Parser.reset_block_indent! lines assert_equal expected, lines end diff --git a/test/test_helper.rb b/test/test_helper.rb index e6b0274e..408724d9 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -177,7 +177,7 @@ class Test::Unit::TestCase def parse_header_metadata(source) reader = Asciidoctor::Reader.new source.split ::Asciidoctor::EOL - [::Asciidoctor::Lexer.parse_header_metadata(reader), reader] + [::Asciidoctor::Parser.parse_header_metadata(reader), reader] end def assign_default_test_options(opts) diff --git a/test/text_test.rb b/test/text_test.rb index 02d59339..24de8da2 100644 --- a/test/text_test.rb +++ b/test/text_test.rb @@ -36,7 +36,7 @@ context "Text" do input.concat(File.readlines(sample_doc_path(:encoding))) doc = empty_document reader = Asciidoctor::PreprocessorReader.new doc, input - block = Asciidoctor::Lexer.next_block(reader, doc) + block = Asciidoctor::Parser.next_block(reader, doc) assert_xpath '//pre', block.render.gsub(/^\s*\n/, ''), 1 end @@ -46,7 +46,7 @@ include::fixtures/encoding.asciidoc[tags=romé] EOS doc = empty_safe_document :base_dir => File.expand_path(File.dirname(__FILE__)) reader = Asciidoctor::PreprocessorReader.new doc, input - block = Asciidoctor::Lexer.next_block(reader, doc) + block = Asciidoctor::Parser.next_block(reader, doc) output = block.render assert_css '.paragraph', output, 1 end |
