raindown 0.2.1 → 0.2.2

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: 3c36e6807f4679d073cdc969831684565451ce3f6fe1c1d09eb89b1b9526faf7
4
- data.tar.gz: 23b34dd9c842c9ad29a159c96f74ff5053df08bc146b4589f2aef22bc0a0e19f
3
+ metadata.gz: d0e77b47d4bdedcda5ace520aff8dabc470b3d49a9d7f2dac83b43d23d0928c2
4
+ data.tar.gz: 0e26371c232241abfcfbaec62a09eb89445299fdd5e4d67273a9c0839bb1982a
5
5
  SHA512:
6
- metadata.gz: 9db6ef5e7a58ee401621073c809f0eaf0d7147a8d265ff68d803eefbd70f161efe8a447b6ec6d5e6e3ad9952f3a7929b4c7ac8f9fa4fd2f5af8778375ff878ba
7
- data.tar.gz: d91807885cf892c6bfc944e20067c87a317558d3062390767bfb2cb32429c88936e9bc90e76e891258bb913e2d3753310a930d140043a75f37dfef3f9a7b9b3c
6
+ metadata.gz: 917089b01769a65e0b96d645613f182fdbd7212760823293ed87dd1581071751f53548bdc84d363c40e5a50d4c4941c10f6a409ded7dd2c5687708581dcd9213
7
+ data.tar.gz: 1ae3a21d68f7bb6fd7042e371cec3352eb7e1781855dcf3a5c92b80c1024a628481c2a3f159be9ee6fb1769592169640f5d767989aadf29bfbadba76ab610849
data/lib/raindown/page.rb CHANGED
@@ -16,7 +16,7 @@ module Raindown
16
16
  # The front matter is rendered with it, so its variables work, and a Raindown file's bare directives too.
17
17
  def content
18
18
  @content ||= begin
19
- markdown = File.read(file_path)
19
+ markdown = File.read(file_path, encoding: Encoding::UTF_8)
20
20
 
21
21
  if FrontMatter.parse(markdown).last.strip.empty? then ''
22
22
  else Raindown.render(markdown:, bare: BareDirectives.file?(file_path), **@render_options)
@@ -60,7 +60,7 @@ module Raindown
60
60
  end
61
61
 
62
62
  def process(file_path:)
63
- metadata = implicit_metadata(file_path:).merge(FrontMatter.parse(File.read(file_path)).first)
63
+ metadata = implicit_metadata(file_path:).merge(FrontMatter.parse(File.read(file_path, encoding: Encoding::UTF_8)).first)
64
64
  @metadata[file_path] = metadata
65
65
  metadata.each { |type, tag| Array(tag).each { |item| tag(type:, tag: item, file_path:) } }
66
66
  end
@@ -21,7 +21,7 @@ module Raindown
21
21
 
22
22
  # Returns true when the file changed.
23
23
  def update(path:, bare: false, execute: false, metadata: NoMetadata)
24
- content = File.read(path)
24
+ content = File.read(path, encoding: Encoding::UTF_8)
25
25
  rewritten = rewrite(content:, path:, bare:, execute:, metadata:)
26
26
  return false if rewritten == content
27
27
 
data/lib/raindown.rb CHANGED
@@ -40,7 +40,7 @@ module Raindown
40
40
 
41
41
  # Directives show in bold, unless the file's project hides them in .raindown/config.yml.
42
42
  def render_file(path:, metadata: NoMetadata, bare: false, hide_directives: Config.for(path)[:hide_directives])
43
- render(markdown: File.read(path), metadata:, bare: bare || BareDirectives.file?(path), hide_directives:)
43
+ render(markdown: File.read(path, encoding: Encoding::UTF_8), metadata:, bare: bare || BareDirectives.file?(path), hide_directives:)
44
44
  end
45
45
 
46
46
  # Front matter keys are variables, like {title} or <{ title }>.
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Raindown
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raindown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - maedi