markdownr 0.4.8 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/markdown_server/app.rb +6 -0
- data/lib/markdown_server/version.rb +1 -1
- data/views/layout.erb +2 -7
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 498dc869909593a83b885a1cc30de710e07b6e686434da94a49c2d2e1f473d41
|
|
4
|
+
data.tar.gz: 83c31394846d27ec2b474465dafa548494b42683e800348e752b080caeb3df42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf3f02fae7411669eb42765b7a65280a55d6e4dca36a77601017fd52c42e2a75adee172d173cf470033d897d75c6a18bb84277094348a3f9b1f578b3d962586e
|
|
7
|
+
data.tar.gz: 8388865e12e977a8f6ec1be0047dd4dd14981d2671bbcb3182fc77e87ccb20ee5617f6b2e8f944b2355187bdffb4a2107ac2266f171aacb848a9d010d4fca137
|
data/lib/markdown_server/app.rb
CHANGED
|
@@ -498,6 +498,9 @@ module MarkdownServer
|
|
|
498
498
|
w.gsub!(/<!--.*?-->/m, " ")
|
|
499
499
|
# Remove known ad/recommendation blocks
|
|
500
500
|
w.gsub!(/Bible\s+Gateway\s+Recommends[\s\S]*?View\s+more\s+titles/i, " ")
|
|
501
|
+
# Remove BibleGateway header/toolbar noise (promo text + login/toolbar block)
|
|
502
|
+
w.gsub!(/trusted\s+resources\s+beside\s+every\s+verse[\s\S]*?Your\s+Content/i, " ")
|
|
503
|
+
w.gsub!(/Log\s+In\s*\/\s*Sign\s+Up[\s\S]*?Your\s+Content/i, " ")
|
|
501
504
|
|
|
502
505
|
# Prefer a focused content block
|
|
503
506
|
content = w.match(/<article[^>]*>(.*?)<\/article>/im)&.[](1) ||
|
|
@@ -514,6 +517,9 @@ module MarkdownServer
|
|
|
514
517
|
end
|
|
515
518
|
end
|
|
516
519
|
|
|
520
|
+
# Strip any preamble before the first heading (site chrome, toolbars, etc.)
|
|
521
|
+
out.sub!(/\A[\s\S]*?(?=<h[1-6]>)/i, "")
|
|
522
|
+
|
|
517
523
|
# Decode HTML entities
|
|
518
524
|
out = out
|
|
519
525
|
.gsub(/ /i, " ").gsub(/&/i, "&").gsub(/</i, "<").gsub(/>/i, ">")
|
data/views/layout.erb
CHANGED
|
@@ -1539,9 +1539,7 @@
|
|
|
1539
1539
|
var extKey = 'ext:' + href;
|
|
1540
1540
|
var extCached = cache[extKey];
|
|
1541
1541
|
if (extCached && typeof extCached === 'object') {
|
|
1542
|
-
showPopup(x, y, extCached.title || label,
|
|
1543
|
-
'<div class="link-ctx-popup-url">' + escHtml(href) + '</div>' +
|
|
1544
|
-
extCached.html);
|
|
1542
|
+
showPopup(x, y, extCached.title || label, extCached.html);
|
|
1545
1543
|
} else if (extCached === false) {
|
|
1546
1544
|
showPopup(x, y, label,
|
|
1547
1545
|
'<div class="link-ctx-popup-url">' + escHtml(href) + '</div>' +
|
|
@@ -1561,10 +1559,7 @@
|
|
|
1561
1559
|
return;
|
|
1562
1560
|
}
|
|
1563
1561
|
cache[extKey] = { title: data.title, html: data.html };
|
|
1564
|
-
updatePopup(
|
|
1565
|
-
'<div class="link-ctx-popup-url">' + escHtml(href) + '</div>' +
|
|
1566
|
-
data.html,
|
|
1567
|
-
data.title || label);
|
|
1562
|
+
updatePopup(data.html, data.title || label);
|
|
1568
1563
|
})
|
|
1569
1564
|
.catch(function() {
|
|
1570
1565
|
cache[extKey] = false;
|