diff --git a/ext/ragel/base_lexer.rl b/ext/ragel/base_lexer.rl index d5f8070..0e552b4 100644 --- a/ext/ragel/base_lexer.rl +++ b/ext/ragel/base_lexer.rl @@ -161,7 +161,7 @@ # instruction. # - proc_ins_start = ''; # Everything except "?" OR a single "?" diff --git a/spec/oga/xml/lexer/processing_instruction_spec.rb b/spec/oga/xml/lexer/processing_instruction_spec.rb index 0803032..46219da 100644 --- a/spec/oga/xml/lexer/processing_instruction_spec.rb +++ b/spec/oga/xml/lexer/processing_instruction_spec.rb @@ -70,6 +70,14 @@ describe Oga::XML::Lexer do ] end + it 'lexes an instruction with a namespace prefix' do + lex('').should == [ + [:T_PROC_INS_START, nil, 1], + [:T_PROC_INS_NAME, 'foo:bar', 1], + [:T_PROC_INS_END, nil, 1] + ] + end + describe 'using an IO as input' do it 'lexes an instruction with a newline after the name' do lex_stringio("").should == [ diff --git a/spec/oga/xml/parser/processing_instruction_spec.rb b/spec/oga/xml/parser/processing_instruction_spec.rb index 32b9462..e0ad6d9 100644 --- a/spec/oga/xml/parser/processing_instruction_spec.rb +++ b/spec/oga/xml/parser/processing_instruction_spec.rb @@ -32,4 +32,11 @@ describe Oga::XML::Parser do @node.text.should == ' bar ' end end + + it 'parses a processing instruction with a namespace prefix' do + node = parse('').children[0] + + node.should be_an_instance_of(Oga::XML::ProcessingInstruction) + node.name.should == 'foo:bar' + end end