Skip to content

Commit 0ca408a

Browse files
authored
Merge pull request #212 from dynamsoft-docs/preview
update to internal commit 003bd576
2 parents 53a4263 + 4ea4250 commit 0ca408a

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

_layouts/default-layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
$('#txtSearch').keydown(function(e) {
181181
if (e.keyCode == 13) {
182182
let product = getUrlVars(document.URL)["product"] ? getUrlVars(document.URL)["product"] : getCurrentUrlProductName(document.URL)
183-
if (["dbr", "dlr", "dce", "dcp", "dcv", "ddn", "mrz"].indexOf(product) >= 0) {
183+
if (["dbr", "dlr", "dce", "dcp", "dcv", "ddn", "mrz", "mds"].indexOf(product) >= 0) {
184184
let lang = getCurrentUrlLang(document.URL, true)
185185
let reporType = ""
186186
if (lang && lang != "core") {

_plugins/custom_alerts.rb

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
module Jekyll
22
Jekyll::Hooks.register [:pages, :posts, :documents], :post_render do |doc|
3-
next unless doc.output && !doc.output.nil?
4-
next unless doc.path.end_with?(".md")
3+
next unless doc.output && doc.path&.end_with?(".md")
54
next unless doc.output.include?("[!")
65

7-
doc.output.gsub!(/<blockquote>\s*<p>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*(.*?)<\/p>\s*<\/blockquote>/mi) do
6+
doc.output.gsub!(%r{<blockquote>(.*?)</blockquote>}mi) do |match|
7+
inner = $1.dup
8+
9+
unless inner =~ /\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i
10+
next match
11+
end
12+
813
type = $1.downcase
9-
text = $2.strip
1014

11-
<<~HTML
12-
<blockquote class="blockquote-#{type}">#{text}</blockquote>
13-
HTML
15+
inner.sub!(/\s*\[!(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/i, '')
16+
17+
inner.gsub!(%r{<p>\s*</p>}mi, '')
18+
19+
%(<blockquote class="blockquote-#{type}">#{inner}</blockquote>)
1420
end
1521
end
1622
end

assets/js/index-banner-v3.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,8 @@ function getDoumentName(product) {
891891
return 'license-server';
892892
case 'mrz':
893893
return 'mrz-scanner';
894+
case 'mds':
895+
return 'mobile-document-scanner';
894896
default:
895897
return '';
896898
}
@@ -925,6 +927,8 @@ function getCurrentUrlProductName(url = null) {
925927
return 'lts';
926928
case 'mrz-scanner':
927929
return 'mrz';
930+
case 'mobile-document-scanner':
931+
return 'mds';
928932
default:
929933
return '';
930934
}

0 commit comments

Comments
 (0)