Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure xml lexer handles unknown DOCTYPEs #1348

Merged
merged 1 commit into from Oct 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/rouge/lexers/mason.rb
Expand Up @@ -15,11 +15,6 @@ def initialize(*)
@perl = Perl.new
end

def self.detect?(text)
return false if text.doctype?(/((?:ht|x)ml)/)
return true if text.doctype?
end

# Note: If you add a tag in the lines below, you also need to modify "disambiguate '*.m'" in file disambiguation.rb
TEXT_BLOCKS = %w(text doc)
PERL_BLOCKS = %w(args flags attr init once shared perl cleanup filter)
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/xml_spec.rb
Expand Up @@ -34,6 +34,7 @@
assert_guess :source => '<?xml version="1.0" ?><html destdir="${reportfolderPath}" encoding="utf-8" />'
assert_guess :source => '<!DOCTYPE xml>'
deny_guess :source => '<!DOCTYPE html>'
assert_guess :source => '<!DOCTYPE unknown>'
end
end
end