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
|
end
|
||||||
|
|
||||||
disambiguate ".md" do |data|
|
disambiguate ".md" do |data|
|
||||||
if /^[-a-z0-9=#!\*\[|]/i.match(data)
|
if /(^[-a-z0-9=#!\*\[|])|<\//i.match(data) || data.empty?
|
||||||
Language["Markdown"]
|
Language["Markdown"]
|
||||||
elsif /^(;;|\(define_)/.match(data)
|
elsif /^(;;|\(define_)/.match(data)
|
||||||
Language["GCC machine description"]
|
Language["GCC machine description"]
|
||||||
|
|||||||
@@ -162,6 +162,13 @@ class TestHeuristcs < Minitest::Test
|
|||||||
})
|
})
|
||||||
end
|
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"]
|
# Candidate languages = ["C++", "Objective-C"]
|
||||||
def test_obj_c_by_heuristics
|
def test_obj_c_by_heuristics
|
||||||
# Only calling out '.h' filenames as these are the ones causing issues
|
# Only calling out '.h' filenames as these are the ones causing issues
|
||||||
|
|||||||
Reference in New Issue
Block a user