satanic_pages 0.3.1 → 0.3.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/satanic_pages/markdown_template_handler.rb +4 -2
- data/lib/satanic_pages/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59bb9126023c975925d2568017fdd9ca4ed3681d278b6c255737500f8e78ba0b
|
|
4
|
+
data.tar.gz: 46bf1d308946b318b655ee1a6e3bd11fcaf348af3a5004ea5dc4a6f3b7bc4571
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b6af6c8d30b6bc4522f9fc78614adaa88d98736df8be22162a10ce45df4204d7f67ccd818740f4396e021017bfda284e25a6681ff46c521c4904892d696228d
|
|
7
|
+
data.tar.gz: 94e3cd2e515d5fe9c64641b7e2f2a6b151368d956c9207c7d37472d309939b735e75cd20ab2c7b3cabf8a0df8bc1eed8c05b9faf90a545a9a12deeadce8e055b
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
module SatanicPages
|
|
4
4
|
class MarkdownTemplateHandler < MarkdownRails::Renderer::Rails
|
|
5
5
|
include Redcarpet::Render::SmartyPants
|
|
6
|
+
TEMPLATE_ANNOTATION_REGEX =
|
|
7
|
+
/<!\p{Pd}{1,2}\s*(BEGIN|END)\s+.*?\s*\p{Pd}{1,2}>/m
|
|
6
8
|
|
|
7
9
|
def preprocess(source)
|
|
8
10
|
frontmatter, rest = Frontmatter.parse(source)
|
|
9
11
|
|
|
10
12
|
render(inline: rest, handler: :erb, locals: {data: frontmatter})
|
|
11
|
-
# Remove template comments
|
|
12
|
-
.gsub(
|
|
13
|
+
# Remove template comments (including SmartyPants converted dashes)
|
|
14
|
+
.gsub(TEMPLATE_ANNOTATION_REGEX, "")
|
|
13
15
|
# Force HTML tags to be inline
|
|
14
16
|
.gsub(/<[^>]*?>/) { |tag| tag.gsub(/\n\s*/, " ") }
|
|
15
17
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: satanic_pages
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mikkel Malmberg
|
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
77
77
|
- !ruby/object:Gem::Version
|
|
78
78
|
version: '0'
|
|
79
79
|
requirements: []
|
|
80
|
-
rubygems_version:
|
|
80
|
+
rubygems_version: 4.0.6
|
|
81
81
|
specification_version: 4
|
|
82
82
|
summary: An embeddable static pages engine for Rails apps and the devil
|
|
83
83
|
test_files: []
|