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 +4 -4
- data/lib/raindown/page.rb +1 -1
- data/lib/raindown/pages.rb +1 -1
- data/lib/raindown/rewriter.rb +1 -1
- data/lib/raindown.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d0e77b47d4bdedcda5ace520aff8dabc470b3d49a9d7f2dac83b43d23d0928c2
|
|
4
|
+
data.tar.gz: 0e26371c232241abfcfbaec62a09eb89445299fdd5e4d67273a9c0839bb1982a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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)
|
data/lib/raindown/pages.rb
CHANGED
|
@@ -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
|
data/lib/raindown/rewriter.rb
CHANGED
|
@@ -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