Add '</' to Markdown heuristic. (#3255)

This commit is contained in:
Lars Brinkhoff
2016-10-03 19:22:34 +02:00
committed by GitHub
parent eeec48198a
commit c863435c84
2 changed files with 8 additions and 1 deletions

View File

@@ -254,7 +254,7 @@ module Linguist
end
disambiguate ".md" do |data|
if /^[-a-z0-9=#!\*\[|]/i.match(data)
if /(^[-a-z0-9=#!\*\[|])|<\//i.match(data) || data.empty?
Language["Markdown"]
elsif /^(;;|\(define_)/.match(data)
Language["GCC machine description"]

View File

@@ -162,6 +162,13 @@ class TestHeuristcs < Minitest::Test
})
end
def test_md_by_heuristics
assert_heuristics({
"Markdown" => all_fixtures("Markdown", "*.md"),
"GCC machine description" => all_fixtures("GCC machine description", "*.md")
})
end
# Candidate languages = ["C++", "Objective-C"]
def test_obj_c_by_heuristics
# Only calling out '.h' filenames as these are the ones causing issues