mirror of https://github.com/licensee/licensee.git
move strip_markdown down, retain ` as markdown to be stripped
This commit is contained in:
parent
2ec66cdd56
commit
265a8926c2
|
@ -11,7 +11,7 @@ module Licensee
|
|||
WHITESPACE_REGEX = /\s+/
|
||||
MARKDOWN_HEADING_REGEX = /\A\s*#+/
|
||||
VERSION_REGEX = /\Aversion.*$/i
|
||||
MARKUP_REGEX = /[#_*=~\[\]()|>]+/
|
||||
MARKUP_REGEX = /[#_*=~\[\]()`|>]+/
|
||||
DEVELOPED_BY_REGEX = /\Adeveloped by:.*?\n\n/im
|
||||
QUOTE_BEGIN_REGEX = /[`'"‘“]/
|
||||
QUOTE_END_REGEX = /['"’”]/
|
||||
|
@ -83,9 +83,9 @@ module Licensee
|
|||
string = strip_developed_by(string)
|
||||
string, _partition, _instructions = string.partition(END_OF_TERMS_REGEX)
|
||||
string = normalize_lists(string)
|
||||
string = strip_markup(string)
|
||||
string = normalize_quotes(string)
|
||||
string = normalize_https(string)
|
||||
string = strip_markup(string)
|
||||
strip_whitespace(string)
|
||||
end
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ RSpec.describe Licensee::Matchers::Dice do
|
|||
|
||||
it 'sorts licenses by similarity' do
|
||||
expect(subject.licenses_by_similiarity[0]).to eql([gpl, 100.0])
|
||||
expect(subject.licenses_by_similiarity[1]).to eql([agpl, 95.71577847439916])
|
||||
expect(subject.licenses_by_similiarity[1]).to eql([agpl, 95.76581285938317])
|
||||
end
|
||||
|
||||
it 'returns a list of licenses above the confidence threshold' do
|
||||
expect(subject.licenses_by_similiarity[0]).to eql([gpl, 100.0])
|
||||
expect(subject.licenses_by_similiarity[1]).to eql([agpl, 95.71577847439916])
|
||||
expect(subject.licenses_by_similiarity[1]).to eql([agpl, 95.76581285938317])
|
||||
end
|
||||
|
||||
it 'returns the match confidence' do
|
||||
|
|
Loading…
Reference in New Issue