marked-conductor 1.0.22 → 1.0.23

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: 4dd28de6ae0aaf52e49579cb6d42e7d5ae46c5e74fa9016c661f983330ba1163
4
- data.tar.gz: 4a376f1832720b796dca464b62e3ee4bc47217892658b043fd0eeaf53417cf13
3
+ metadata.gz: 0bd701f59c197143e9a8744da69209db39e2b2f124cd239cd0c21bd11f791b81
4
+ data.tar.gz: e18d60353643a68a1b93f1f73c7f7f7e2bf26884593e2b7b2895f0b775a8c102
5
5
  SHA512:
6
- metadata.gz: bdfe7d8bfd2834f5bd21ef4c2294f5b1295e26c0e065154f671bcde34ac81af5c79b2beb9405f8b71a69156a69143ead64609ee327459f41f37bfbf7fe0ad739
7
- data.tar.gz: 5aece7af60fd7a296cc21ab28ea64d8cd5fe8fd22e2dd93c6fe1b7579080aba8bc6aca61fb945c015ecb3899114a2663b4ff98c69b7eadb24c24f79987fc3568
6
+ metadata.gz: 86811c1cee6bc68847e79231af591abe4f94aa45fea9eb8e9ac9c3f288dd92e26db64068b405a647523829fa1109d4fa8fea699cfa73a0e3d527a924ae1db074
7
+ data.tar.gz: ca22bf9fa7db8390b7a0b0851d1d71e58c8cb45e4454d21d49b9cac455343f09ca67068e343acb2373df7250284c69b791d9d4510bbee58fccd6bf490294565b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.0.23
2
+
3
+ 2024-07-17 15:51
4
+
5
+ #### FIXED
6
+
7
+ - Environment variable escaping was hyperactive, only escape includes array
8
+
1
9
  ### 1.0.22
2
10
 
3
11
  2024-07-16 12:30
data/lib/conductor/env.rb CHANGED
@@ -56,12 +56,12 @@ module Conductor
56
56
  "MARKED_CSS_PATH" => @env[:css_path],
57
57
  "MARKED_EXT" => @env[:ext],
58
58
  "MARKED_ORIGIN" => @env[:origin],
59
- "MARKED_INCLUDES" => @env[:includes],
59
+ "MARKED_INCLUDES" => Shellwords.escape(@env[:includes]),
60
60
  "MARKED_PATH" => @env[:filepath],
61
61
  "MARKED_PHASE" => @env[:phase],
62
62
  "OUTLINE" => @env[:outline],
63
63
  "PATH" => @env[:path]
64
- }.map { |k, v| %(#{k}="#{Shellwords.escape(v)}") }.join(" ")
64
+ }.map { |k, v| %(#{k}="#{v}") }.join(" ")
65
65
  end
66
66
  end
67
67
  end
@@ -2,6 +2,19 @@
2
2
 
3
3
  # String helpers
4
4
  class ::String
5
+ def find_file_in(paths, filename, ext)
6
+ return filename if File.exist?(filename)
7
+
8
+ filename = File.basename(filename, ".#{ext}")
9
+
10
+ paths.each do |path|
11
+ exp = File.join(File.expand_path('~/.config/conductor/'), path, "#{filename}.#{ext}")
12
+ return exp if File.exist?(exp)
13
+ end
14
+
15
+ "#{filename}.#{ext}"
16
+ end
17
+
5
18
  def normalize_filter
6
19
  parts = match(/(?<filter>[\w_]+)(?:\((?<paren>.*?)\))?$/i)
7
20
  filter = parts["filter"].downcase.gsub(/_/, "")
@@ -9,6 +22,11 @@ class ::String
9
22
  [filter, params]
10
23
  end
11
24
 
25
+ ##
26
+ ## Determine type of metadata (yaml, mmd, none)
27
+ ##
28
+ ## @return [Symbol] metadata type
29
+ ##
12
30
  def meta_type
13
31
  lines = split(/\n/)
14
32
  case lines[0]
@@ -124,7 +142,8 @@ class ::String
124
142
  end
125
143
 
126
144
  def insert_stylesheet(path)
127
- inject_after_meta(%(<link rel="stylesheet" href="#{ERB::Util.url_encode(path.strip)}">))
145
+ path = find_file_in(['css', 'styles'], path, 'css') unless path =~ /^http/
146
+ inject_after_meta(%(<link rel="stylesheet" href="#{path.strip}">))
128
147
  end
129
148
 
130
149
  def insert_css(path)
@@ -514,6 +533,11 @@ class Filter < String
514
533
  content = Conductor.stdin
515
534
 
516
535
  case @filter
536
+ when /(insert|add|inject)stylesheet/
537
+ @params.each do |sheet|
538
+ content = content.insert_stylesheet(sheet)
539
+ end
540
+ content
517
541
  when /(insert|add|inject)(css|style)/
518
542
  @params.each do |css|
519
543
  content = content.insert_css(css)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Conductor
4
- VERSION = '1.0.22'
4
+ VERSION = '1.0.23'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marked-conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.22
4
+ version: 1.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-16 00:00:00.000000000 Z
11
+ date: 2024-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print