hamlit 0.3.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/lib/hamlit/parser.rb +1 -1
- data/lib/hamlit/version.rb +1 -1
- data/spec/hamlit/engine/text_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41181b03fb2da5795efd910df32b4af7dec36c76
|
4
|
+
data.tar.gz: 5c87563fb9b05df21292a6fef7893d776030a422
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9179fb592fc4469d868ce8c13d44559db430cc3485c1774283006f36664dd6ed91f196fa6b7860cc0d810efaab353b30b97a1c85be85f8fd8e86c2b0ced0d624
|
7
|
+
data.tar.gz: 80f76409f03008b7a0bb951f26c9edaf2a5c9071b031ce47d12de288672cebf766c0da3787121a55d805d13eb66543a7bf532ba81ca382219c8493a6968cb272
|
data/README.md
CHANGED
@@ -49,6 +49,21 @@ Hamlit is used on [githubranking.com](http://githubranking.com/).
|
|
49
49
|
Basically the same as [haml](https://github.com/haml/haml).
|
50
50
|
Check out the [reference documentation](http://haml.info/docs/yardoc/file.REFERENCE.html) for details.
|
51
51
|
|
52
|
+
### Rails
|
53
|
+
|
54
|
+
Just update Gemfile.
|
55
|
+
|
56
|
+
### Sinatra
|
57
|
+
|
58
|
+
For compatibility with Haml, Hamlit does not escape html automatically in sinatra.
|
59
|
+
You can enable html escaping manually:
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
configure do
|
63
|
+
Hamlit::Engine.set_default_options(escape_html: true)
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
52
67
|
## Why high performance?
|
53
68
|
### Less work on runtime
|
54
69
|
Haml's rendering is very slow because generated code by haml runs many operations on runtime.
|
data/lib/hamlit/parser.rb
CHANGED
@@ -82,7 +82,7 @@ module Hamlit
|
|
82
82
|
|
83
83
|
scanner = StringScanner.new(line)
|
84
84
|
scanner.scan(/ +/)
|
85
|
-
if scanner.match?(/\#{/)
|
85
|
+
if scanner.scan(/\\/) || scanner.match?(/\#{/)
|
86
86
|
return parse_text(scanner)
|
87
87
|
elsif scanner.match?(/&=/)
|
88
88
|
return parse_script(scanner, force_escape: true)
|
data/lib/hamlit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamlit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: temple
|