move strip_markdown down, retain ` as markdown to be stripped

This commit is contained in:
Mike Linksvayer 2018-08-20 10:01:26 -07:00
parent 2ec66cdd56
commit 265a8926c2
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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