markdownr 0.5.19 → 0.5.21

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: a3cd57887599183f3350f1dd63f44f636ab03b9d3c3a462a1aaec04793cbbfeb
4
- data.tar.gz: 8ecb0febc8ba672c28ad2cc9d2cdea0cbe7a1e1c79508bb0ec1b4fcb40c133fa
3
+ metadata.gz: 8453e4e0a362ba8e9c10523c1de11a0372971eedacaadc399a37dd3971f20a20
4
+ data.tar.gz: da228300eee2d6e8e03a2d1e501a8ff6fc7ee27bb83706254a8abe7354c5e1d6
5
5
  SHA512:
6
- metadata.gz: 83b163d0b783c29163dfc8d7803e0536dd78a295d7b4d72518dd55015b7e302fae23d83bec507fb1f363eee3af2f5e031f5ca8fd9a42de10c42ff72bce996446
7
- data.tar.gz: b6a498d1d81abdd6ad981c4c930ba934776895c2606bc0ae9ae42bcfb71890d79be8bcdeec55e190c36199c34ed6b74ce2926b1705161ba862f68752b2d9a838
6
+ metadata.gz: ac8aefdee7fefc43e3d9282cd612b5a0e8ac9b96e7ab7c710cc8e2d52da10e58d48b03aaf2c35938b87eed09243f98f70528c45eadc841f331ae36cc3a2c3797
7
+ data.tar.gz: cabbff0b16dae2e73ad37339c66bdf231684e53469c782151bc0099414c97d02660f015b92a38f112d433e83b9286ba1a91cf5a52cf59bbc5355e2be79c82fc5
@@ -34,7 +34,6 @@ module MarkdownServer
34
34
  set :verbose, false
35
35
  set :session_secret, ENV.fetch("MARKDOWNR_SESSION_SECRET", SecureRandom.hex(64))
36
36
  set :sessions, key: "markdownr_session", same_site: :strict, httponly: true
37
- set :popup_assets_content, File.read(File.join(settings.views, "popup_assets.erb"))
38
37
  end
39
38
 
40
39
  helpers do
@@ -788,8 +787,8 @@ module MarkdownServer
788
787
 
789
788
  # Returns true when serving an HTML file that should have popup assets injected.
790
789
  # Add additional path prefixes here as needed.
791
- def inject_assets_for_html_path?(relative_path)
792
- relative_path.start_with?("scripture/resources/books/bible")
790
+ def inject_assets_for_html_path?(_relative_path)
791
+ true
793
792
  end
794
793
 
795
794
  # Injects popup CSS and JS into an HTML document before </body>.
@@ -801,7 +800,7 @@ module MarkdownServer
801
800
  %(<a href="#{h(url)}">#{h(citation)}</a>)
802
801
  end
803
802
 
804
- assets = settings.popup_assets_content
803
+ assets = File.read(File.join(settings.views, "popup_assets.erb"))
805
804
  inserted = false
806
805
  result = html_content.sub(/<\/(body|html)>/i) { inserted = true; "#{assets}</#{$1}>" }
807
806
  inserted ? result : html_content + assets
@@ -1,3 +1,3 @@
1
1
  module MarkdownServer
2
- VERSION = "0.5.19"
2
+ VERSION = "0.5.21"
3
3
  end
data/views/layout.erb CHANGED
@@ -2104,6 +2104,7 @@
2104
2104
  var href = anchor.getAttribute('href');
2105
2105
  if (!href || isAnchorOnly(href)) { hidePopup(); return; }
2106
2106
  if (!anchor.closest('.md-content') && !anchor.closest('.frontmatter')) { hidePopup(); return; }
2107
+ if (!isLocalMd(href) && !isExternal(href)) { hidePopup(); return; }
2107
2108
  e.preventDefault();
2108
2109
  handleLink(anchor, e.clientX, e.clientY);
2109
2110
  });
@@ -2126,6 +2127,7 @@
2126
2127
  var href = anchor.getAttribute('href');
2127
2128
  if (!href || isAnchorOnly(href)) { hidePopup(); return; }
2128
2129
  if (!anchor.closest('.md-content') && !anchor.closest('.frontmatter')) { hidePopup(); return; }
2130
+ if (!isLocalMd(href) && !isExternal(href)) { hidePopup(); return; }
2129
2131
  e.preventDefault();
2130
2132
  var touch = e.changedTouches[0];
2131
2133
  handleLink(anchor, touch.clientX, touch.clientY);
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.5.19
4
+ version: 0.5.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dunn