mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add '</' to Markdown heuristic. (#3255)
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user