slideshow 0.9 → 0.9.1
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.
- data/lib/slideshow.rb +1 -1
- data/lib/slideshow/filters/text_filter.rb +12 -2
- data/lib/slideshow/gen.rb +2 -2
- metadata +4 -3
data/lib/slideshow.rb
CHANGED
@@ -5,7 +5,8 @@
|
|
5
5
|
|
6
6
|
module TextFilter
|
7
7
|
|
8
|
-
def comments_percent_style( content )
|
8
|
+
def comments_percent_style( content )
|
9
|
+
|
9
10
|
# remove comments
|
10
11
|
# % comments
|
11
12
|
# %begin multiline comment
|
@@ -28,8 +29,17 @@ module TextFilter
|
|
28
29
|
""
|
29
30
|
end
|
30
31
|
|
32
|
+
# hack/note:
|
33
|
+
# note multi-line erb expressions/stmts might cause trouble
|
34
|
+
#
|
35
|
+
# %> gets escaped as special case (not treated as comment)
|
36
|
+
# <%
|
37
|
+
# whatever
|
38
|
+
# %> <!-- trouble here; would get removed as comment!
|
39
|
+
# todo: issue warning?
|
40
|
+
|
31
41
|
# remove single-line comments
|
32
|
-
content.gsub!(
|
42
|
+
content.gsub!(/(^%$)|(^%[^>].*)/ ) do |match|
|
33
43
|
comments_single += 1
|
34
44
|
""
|
35
45
|
end
|
data/lib/slideshow/gen.rb
CHANGED
@@ -557,13 +557,13 @@ class Gen
|
|
557
557
|
logger.debug " adding css classes: #{slide.classes}"
|
558
558
|
end
|
559
559
|
|
560
|
-
if slide_source =~ /^\s*(<h1
|
560
|
+
if slide_source =~ /^\s*(<h1.*?>.*?<\/h\d>)\s*(.*)/m # try to cut off header using non-greedy .+? pattern; tip test regex online at rubular.com
|
561
561
|
slide.header = $1
|
562
562
|
slide.content = ($2 ? $2 : "")
|
563
563
|
logger.debug " adding slide with header:\n#{slide.header}"
|
564
564
|
else
|
565
565
|
slide.content = slide_source
|
566
|
-
logger.debug " adding slide with *no* header"
|
566
|
+
logger.debug " adding slide with *no* header:\n#{slide.content}"
|
567
567
|
end
|
568
568
|
slides2 << slide
|
569
569
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slideshow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 57
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.9.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Gerald Bauer
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-05 00:00:00 +02:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|