From f5aabcf27622f5239f33e1821238e6a6be70dddf Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 27 May 2017 15:11:02 +0200 Subject: [PATCH] Change link scheme to HTTPS. Bump version number. Also use symbol instead of string for 'Originaltext'. Signed-off-by: Thomas Hochstein --- _doc/dejure/CHANGELOG.md | 4 ++++ lib/filters/dejure.rb | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/_doc/dejure/CHANGELOG.md b/_doc/dejure/CHANGELOG.md index cdecde3..7ce7676 100644 --- a/_doc/dejure/CHANGELOG.md +++ b/_doc/dejure/CHANGELOG.md @@ -2,6 +2,10 @@ ## 1.x branch +### Version 1.2 (unreleased) + +* Create links with `https` protocol. + ### Version 1.1 (2017-05-27) * Add option to exclude headings from link generation. diff --git a/lib/filters/dejure.rb b/lib/filters/dejure.rb index 0990428..f50956e 100644 --- a/lib/filters/dejure.rb +++ b/lib/filters/dejure.rb @@ -42,7 +42,7 @@ module Nanoc::Filters identifier :dejure type :text - VERSION = '1.1' + VERSION = '1.2-beta' CACHEDIR = 'tmp/dejure-org' CACHEDAYS = 7 @@ -76,6 +76,7 @@ module Nanoc::Filters params[:format] ||= 'weit' params[:buzer] ||= 1 params[:ohnehtags] = params.delete(:noheadings) + params[:Schema] = 'https' return params end @@ -91,7 +92,7 @@ module Nanoc::Filters request['Content-Type'] = 'application/x-www-form-urlencoded' formdata = params - formdata['Originaltext'] = input + formdata[:Originaltext] = input request.set_form_data(formdata) response = http.request(request) @@ -170,7 +171,7 @@ module Nanoc::Filters def integrity_check (input,output) # compare input and output text after removing all added links - texts should match! - regexp = /]*>([^<]*)<\/a>/i if input.strip.gsub(regexp, '\\1') == output.strip.gsub(regexp, '\\1') return output else