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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc26010b968e9e71f263a712100cac36ff0f6254b5c3a7f89c4f71e5dfc42e8e
4
- data.tar.gz: 45fbe7488f164f1fa99e4e7a23bfb0c2c4794ac0f9f549ef9bb7d63408991a89
3
+ metadata.gz: 498dc869909593a83b885a1cc30de710e07b6e686434da94a49c2d2e1f473d41
4
+ data.tar.gz: 83c31394846d27ec2b474465dafa548494b42683e800348e752b080caeb3df42
5
5
  SHA512:
6
- metadata.gz: b7037aaf1b59865d8d5abab5d4e1887dee3ed3b2e8abaccc179a7faedc5e909397c7a5ee48de4504ecd2b52eb67171dc54f6bcd5e981d450117df42c1f772dd3
7
- data.tar.gz: 0fa16c47e3ae9d72f84ba87b5c4f9da0872d86c248716db8614ac3f6f3ce9b8624fa9618049368d352635b1b26e7659d82f9e630cb97743dde3f7712ca76f461
6
+ metadata.gz: bf3f02fae7411669eb42765b7a65280a55d6e4dca36a77601017fd52c42e2a75adee172d173cf470033d897d75c6a18bb84277094348a3f9b1f578b3d962586e
7
+ data.tar.gz: 8388865e12e977a8f6ec1be0047dd4dd14981d2671bbcb3182fc77e87ccb20ee5617f6b2e8f944b2355187bdffb4a2107ac2266f171aacb848a9d010d4fca137
@@ -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(/&nbsp;/i, " ").gsub(/&amp;/i, "&").gsub(/&lt;/i, "<").gsub(/&gt;/i, ">")
@@ -1,3 +1,3 @@
1
1
  module MarkdownServer
2
- VERSION = "0.4.8"
2
+ VERSION = "0.4.9"
3
3
  end
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;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdownr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dunn