1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
Commit graph

34 commits

Author SHA1 Message Date
Nathan Weizenbaum
7ef8110c22 [Haml] Add a :css filter. 2009-11-09 19:46:36 -08:00
Nathan Weizenbaum
02e0e390d1 Merge branch 'sass-rack'
Conflicts:
	doc-src/SASS_CHANGELOG.md
2009-11-09 19:28:25 -08:00
Nathan Weizenbaum
620acebae4 [Haml] Fix a minor doc issue. 2009-11-09 14:21:57 -08:00
Nathan Weizenbaum
2ce9601720 Merge branch 'stable'
Conflicts:
	doc-src/HAML_CHANGELOG.md
2009-11-08 16:17:38 -08:00
Nathan Weizenbaum
76bd406875 [Haml] Add support for a workaround for fake ASCII input strings.
Closes gh-3

This is a complicated issue, but I'll do my best to explain it here.
By default, Haml encodes its templates as Encoding.default_internal,
which is usually UTF-8. This means that strings printed to the
template should be either UTF-8 or UTF-8-compatible ASCII. So far, all
well and good.

Now, it's possible to have strings that are marked as ASCII-8bit, but
which aren't UTF-8 compatible. This includes valid UTF-8 strings that
are forced into an ASCII-8bit encoding. If one of these strings is
concatenated to a UTF-8 string, Ruby says "I don't know what to do
with these non-ASCII characters!" and throws an encoding error. I call
this sort of string "fake ASCII."

This is what was happening in the referenced GitHub issue (or at least
in the sample app Adam Salter created at
http://github.com/adamsalter/test-project/tree/haml_utf8). The
template was UTF-8 encoded, and it was being passed a fake ASCII
string, marked as ASCII-8bit but with UTF-8 byte sequences in it, and
it was choking.

The issue now becomes: where is this fake ASCII string coming from?
From the database. The database drivers used by Rails aren't Ruby 1.9
compatible. Despite storing UTF-8 strings in the database, the drivers
return fake ASCII strings.

The best solution to this is clearly to fix the database drivers, but
that will probably take some time. One stop-gap would be to call
`force_encoding("utf-8")` on all the database values somewhere, which
is still a little annoying. Finally, the solution provided in this
commit is to set `:encoding => "ascii-8bit"` for Haml. This makes the
Haml template itself fake ASCII, which is wrong but will help prevent
encoding errors.
2009-11-08 15:59:52 -08:00
Nathan Weizenbaum
e0b9eb3172 Merge branch 'stable' 2009-10-28 23:12:08 -07:00
Nathan Weizenbaum
5d7e90c2b4 [Haml] Fix the reference w.r.t. exactly how pres and textareas auto-preserve.
It's not actually the case that they preserve nested content;
this would be very difficult to do in a general way.
They actually only generate content given with =.

Closes gh-46
2009-10-28 23:11:19 -07:00
Nathan Weizenbaum
6a5dcc031f Merge branch 'html2haml'
Conflicts:
	doc-src/HAML_REFERENCE.md
2009-10-23 02:31:01 -07:00
Nathan Weizenbaum
bda1bbcf3b Merge branch 'stable' 2009-10-23 01:06:44 -07:00
Nathan Weizenbaum
dd4a0675bc [Haml] Make the individual filters show up in the table of contents. 2009-10-23 01:06:40 -07:00
Nathan Weizenbaum
8b45b30ef3 Merge branch 'master' into html2haml
Conflicts:
	doc-src/HAML_CHANGELOG.md
2009-10-20 01:07:37 -07:00
Nathan Weizenbaum
3750557505 Merge branch 'stable'
Conflicts:
	VERSION
	doc-src/HAML_CHANGELOG.md
	doc-src/SASS_CHANGELOG.md
2009-10-17 15:47:55 -07:00
Nathan Weizenbaum
df25c38fde [Haml] Make the reference docs on HTML-escaping more clear. 2009-10-17 15:46:58 -07:00
Nathan Weizenbaum
d460b8fbce Merge branch 'stable' 2009-10-17 15:14:12 -07:00
Nathan Weizenbaum
c850140763 [Haml] Document the XSS support. 2009-10-17 15:13:35 -07:00
Nathan Weizenbaum
9122a94459 [Haml] [html2haml] Change references to RHTML in html2haml code to ERb. 2009-10-05 03:45:05 -07:00
Nathan Weizenbaum
2f4d57633d Merge branch 'stable' 2009-07-19 16:30:01 -07:00
Nathan Weizenbaum
6efc9ba23a [Haml] Filters now don't respect :escape_html.
This is a temporary solution. Filters should really be allowed to
specify whether or not they need HTML escaping.
2009-07-19 16:29:54 -07:00
Nathan Weizenbaum
ebd34950ed Merge commit 'halorgium/custom_haml_class' 2009-07-12 11:15:20 -04:00
Nathan Weizenbaum
f5384c95fd [Haml] Update the reference again. 2009-07-05 03:07:06 -07:00
Nathan Weizenbaum
5ae3231619 [Haml] Add an anchor for the multiline section of the reference. 2009-07-05 01:57:02 -07:00
Nathan Weizenbaum
2585333c71 [Haml] Tweak the reference a bit. 2009-07-05 01:51:26 -07:00
Tim Carey-Smith
1e49eb1a87 [Haml] Add support for overriding the object_ref of an Object.
This is for overriding the default behavior of the object_ref function
which currently defaults to the underscored class name of the Object.
2009-07-05 13:43:57 +12:00
Nathan Weizenbaum
8978a7066f [Haml] Document :ugly.
Why wasn't this done before?
2009-07-04 18:14:24 -07:00
Nathan Weizenbaum
937cfedc79 [Haml] Add HTML-style attributes to the reference. 2009-07-04 15:40:23 -07:00
Nathan Weizenbaum
ef58f87f78 [Haml] Add an option to set the encoding of the document (default UTF-8). 2009-07-01 00:19:46 -07:00
Nathan Weizenbaum
f1d849d99f [Haml] Note multiline attribute hashes in the multiline section of the reference. 2009-06-28 13:09:28 -07:00
Nathan Weizenbaum
908b15f1bb [Haml] Update reference with a plugin section. 2009-06-25 00:28:49 -07:00
Nathan Weizenbaum
40480eb65d Add some anchor references where they'd be useful. 2009-06-19 03:00:57 -07:00
Nathan Weizenbaum
3847bea2aa Move the options documentation to a more prominent place. 2009-06-19 02:21:34 -07:00
Nathan Weizenbaum
615dac749a [Haml] Re-organize the reference. 2009-06-19 00:20:37 -07:00
Nathan Weizenbaum
91ae36ade2 Move around the Blocks section in the Haml reference. 2009-06-18 15:01:58 -07:00
Nathan Weizenbaum
05f3e00b27 Add tables of contents to the references and FAQ. 2009-06-18 14:56:02 -07:00
Nathan Weizenbaum
73dd210858 Move the Haml and Sass references into their own files. 2009-06-18 13:40:57 -07:00