riven 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1fec2b7cfe9006f62d2698662b853c3316b0dad
4
- data.tar.gz: de862e64da2cd58c5b3c5d6e6c84bff7a633cf06
3
+ metadata.gz: 041073e77332410b3beec7c6f5e2510020034e95
4
+ data.tar.gz: 6e39be4418714492d5ca7f2c99c0dd0bd3f11b72
5
5
  SHA512:
6
- metadata.gz: ac12bff4693139e89663306b4fce14eb6c3446c560abe2c7bd8503faed9bb5a9e3126729155ad7cc99334b0d744365126bf9f4a53ed963ca2c7ee74ebcdec2da
7
- data.tar.gz: 7bae00360b4eb869b090e495b9583917ae74ea06c72c771aaa030cbe1f66a37f9b16c46850f5946dc3cf873a0a02c594b8815c68c18465a88e3b56d3e8c2b682
6
+ metadata.gz: 9d112db24fac421b1d166f181c7660368931eacfe7e5158c2c61997585c26eff6764626af9e0080ffc6c178e39634e18671b19abd14cf017d26677a3cb6a207a
7
+ data.tar.gz: 594129231909ba0208df4cf014534660faf61dff2751d5b6eb6b4a480f87f2eb662b56226e3659e7eb741901c9cb1688055062251aee9ebd9aa66afa0a3ee257
@@ -34,6 +34,7 @@ module Riven
34
34
  public def markup_to_html(markup)
35
35
  code = Riven::Markup::Code.new
36
36
 
37
+ markup = MarkupFile.remove_escape_sequences(markup)
37
38
  markup = code.extract(markup)
38
39
 
39
40
  opts = {
@@ -62,4 +63,4 @@ module Riven
62
63
  @html_file.delete!
63
64
  end
64
65
  end
65
- end
66
+ end
@@ -41,9 +41,18 @@ module Riven
41
41
  loop do
42
42
  non_found = true
43
43
 
44
- @markup.gsub!(/<<\[\s*([^\]\s]+)\s*\]/) do |inc|
45
- non_found = false
46
- MarkupFile.new(@dirname.to_s + '/' + $1).markup
44
+ @markup.gsub!(/(.)?<<\[\s*([^\]\s]+)\s*\]/) do |inc|
45
+ if $1 == '_'
46
+ # special secret escape sign, will be removed afterwards.
47
+ # Required to avoid recursive substitution
48
+ inc.gsub!('_', '¦')
49
+ inc
50
+ elsif $1 == '¦'
51
+ inc
52
+ else
53
+ non_found = false
54
+ ($1 ? $1 : '') + MarkupFile.new(@dirname.to_s + '/' + $2).markup
55
+ end
47
56
  end
48
57
 
49
58
  break if non_found
@@ -96,6 +105,15 @@ module Riven
96
105
  private def exclude?(except, file)
97
106
  except.select { |f| f != '' && f.path === file.path }.any?
98
107
  end
108
+
109
+
110
+ #
111
+ # Removes the internal escape sequence
112
+ #
113
+
114
+ public def remove_escape_sequences(markup)
115
+ markup.gsub('¦', '')
116
+ end
99
117
  end
100
118
  end
101
119
  end
@@ -1,3 +1,3 @@
1
1
  module Riven
2
- VERSION = '1.1.3'
2
+ VERSION = '1.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riven
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Kammerl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2015-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler