contentfs 0.6.2 → 0.7.0

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: 44c0630662c386eee30711ce48061817fecc4d20b619d524b2496811472062a4
4
- data.tar.gz: b605d224de8a8662cedfa5df0404206b6f5b05d66616954d1e781a1c0845dec6
3
+ metadata.gz: d306cf3d13ffb780150e9666fa6693854dbc890661f394347bbea65ae70729f0
4
+ data.tar.gz: 5c01ca933b98c6cdbb1d402796fcefc738a5557e5967ee2cf9ca802972a5d809
5
5
  SHA512:
6
- metadata.gz: f6fe40b8bbb1b4f05cd85b4bca5d5535b2cbe73886e679153e02a510a62d3bbe113ac5caa8b8c41b3f77b9c2331b2ff8f2b615a8aae507119394b9cdae3bb232
7
- data.tar.gz: 50fe653eb6e89011b9ce39021c04e67c26e7037043b536c9776d03f7fc1212621b93a3663785c01e06897346f7d09a67e67ef2fdd9bb043e734fca723e08cc1a
6
+ metadata.gz: 3f2196a1436b9057ccb50a69bcd38bffa40c9d171e846bb6aa5bda478cb26a9677cfc294f8ea5543b6169673173040ea12603bbc06aa74af354350f9c613bad9
7
+ data.tar.gz: 2b4e549b0481a2da7fb093de521532f2e32865fdf7a275915c7ff46f8571f3b897b6449bce4de6e549999594d7286cacba73008b41e4186ee4a6ed547426f57a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [v0.7.0](https://github.com/metabahn/contentfs/releases/tag/v0.7.0)
2
+
3
+ *released on 2021-04-07*
4
+
5
+ * `add` [#15](https://github.com/metabahn/contentfs/pull/15) Add support for typed blockquotes ([bryanp](https://github.com/bryanp))
6
+
1
7
  ## [v0.6.2](https://github.com/metabahn/contentfs/releases/tag/v0.6.2)
2
8
 
3
9
  *released on 2021-04-05*
@@ -8,7 +8,37 @@ module ContentFS
8
8
  class Markdown
9
9
  class << self
10
10
  def render(content)
11
- CommonMarker.render_html(content, [:DEFAULT, :UNSAFE])
11
+ renderer.render(CommonMarker.render_doc(content))
12
+ end
13
+
14
+ private def renderer
15
+ ContentFSRenderer.new(options: [:DEFAULT, :UNSAFE])
16
+ end
17
+ end
18
+
19
+ class ContentFSRenderer < CommonMarker::HtmlRenderer
20
+ def blockquote(node)
21
+ blockquote_type = if (match = node.to_plaintext.strip.match(/\[(.*)\]/))
22
+ match[1]
23
+ end
24
+
25
+ blockquote_class = if blockquote_type
26
+ " class=\"#{blockquote_type}\""
27
+ end
28
+
29
+ block do
30
+ container("<blockquote#{sourcepos(node)}#{blockquote_class}>\n", "</blockquote>") do
31
+ node.each.with_index do |child, index|
32
+ content = if blockquote_class && index == 0
33
+ child.to_html.gsub("<p>[#{blockquote_type}] ", "<p>")
34
+ else
35
+ child
36
+ end
37
+
38
+ out(content)
39
+ end
40
+ end
41
+ end
12
42
  end
13
43
  end
14
44
  end
@@ -19,13 +19,13 @@ module ContentFS
19
19
  end
20
20
  end
21
21
 
22
- class SyntaxRenderer < CommonMarker::HtmlRenderer
22
+ class SyntaxRenderer < ContentFSRenderer
23
23
  def code_block(node)
24
24
  block do
25
25
  language = node.fence_info.split(/\s+/)[0]
26
26
  out("<div class=\"highlight\"><pre class=\"highlight #{language}\"><code>")
27
27
  out(syntax_highlight(node.string_content, language))
28
- out('</code></pre></div>')
28
+ out("</code></pre></div>")
29
29
  end
30
30
  end
31
31
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentFS
4
- VERSION = "0.6.2"
4
+ VERSION = "0.7.0"
5
5
 
6
6
  def self.version
7
7
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Powell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-05 00:00:00.000000000 Z
11
+ date: 2021-04-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A structured content file system.
14
14
  email: bryan@metabahn.com
@@ -40,7 +40,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 2.5.0
43
+ version: 2.6.7
44
44
  required_rubygems_version: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="