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

Merge commit 'origin/stable' into stable

This commit is contained in:
Nathan Weizenbaum 2009-11-23 12:35:57 -08:00
commit f854644275
7 changed files with 49 additions and 27 deletions

View file

@ -80,6 +80,7 @@ task :release => [:check_release, :release_elpa, :package] do
sh %{rubyforge add_file haml haml "#{name} (v#{version})" pkg/haml-#{version}.tar.gz}
sh %{rubyforge add_file haml haml "#{name} (v#{version})" pkg/haml-#{version}.tar.bz2}
sh %{rubyforge add_file haml haml "#{name} (v#{version})" pkg/haml-#{version}.zip}
sh %{gem push pkg/haml-#{version}.gem}
end
# Releases haml-mode.el and sass-mode.el to ELPA.

View file

@ -1 +1 @@
2.2.13
2.2.14

View file

@ -3,13 +3,16 @@
* Table of contents
{:toc}
## 2.2.14
## [2.2.14](http://github.com/nex3/haml/commit/2.2.14)
* Don't print warnings when escaping attributes containing non-ASCII characters
in Ruby 1.9.
* Don't crash when parsing an XHTML Strict doctype in `html2haml`.
* Support the HTML5 doctype in an XHTML document
by using `!!! 5` as the doctype declaration.
## [2.2.13](http://github.com/nex3/haml/commit/2.2.13)
* Allow users to specify {file:HAML_REFERENCE.md#encoding_option `:encoding => "ascii-8bit"`}
@ -21,7 +24,7 @@
## [2.2.12](http://github.com/nex3/haml/commit/2.2.12)
There were no changes made to Sass between versions 2.2.11 and 2.2.12.
There were no changes made to Haml between versions 2.2.11 and 2.2.12.
## [2.2.11](http://github.com/nex3/haml/commit/2.2.11)

View file

@ -639,40 +639,55 @@ is compiled to:
</body>
</html>
You can also specify the version and type of XHTML after the `!!!`.
XHTML 1.0 Strict, Transitional, and Frameset and XHTML 1.1 are supported.
The default version is 1.0 and the default type is Transitional.
For example:
You can also specify the specific doctype after the `!!!`
When the [`:format`](#format) is set to `:xhtml` (the default),
the following doctypes are supported:
!!! 1.1
`!!!`
: XHTML 1.0 Transitional<br/>
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">`
is compiled to:
`!!! Strict`
: XHTML 1.0 Strict<br/>
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">`
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
`!!! Frameset`
: XHTML 1.0 Frameset<br/>
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">`
and
`!!! 5`
: XHTML 5<br/>
`<!DOCTYPE html>`<br/>
!!! Strict
`!!! 1.1`
: XHTML 1.1<br/>
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">`
is compiled to:
`!!! Basic`
: XHTML Basic 1.1<br/>
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> `
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
`!!! Mobile`
: XHTML Mobile 1.2<br/>
`<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">`
while
When the [`:format`](#format) option is set to `:html4`,
the following doctypes are supported:
!!! Basic
`!!!`
: HTML 4.01 Transitional<br/>
`<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">`
is compiled to:
`!!! Strict`
: HTML 4.01 Strict<br/>
`<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">`
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
`!!! Frameset`
: HTML 4.01 Frameset<br/>
`<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">`
and
!!! Mobile
is compiled to:
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
When the [`:format`](#format) option is set to `:html5`,
`!!!` is always `<!DOCTYPE html>`.
If you're not using the UTF-8 character set for your document,
you can specify which encoding should appear

View file

@ -3,7 +3,7 @@
* Table of contents
{:toc}
## 2.2.14 (Unreleased)
## [2.2.14](http://github.com/nex3/haml/commit/2.2.14)
* All Sass functions now raise explicit errors if their inputs
are of the incorrect type.

View file

@ -82,7 +82,7 @@ module Haml
MID_BLOCK_KEYWORD_REGEX = /^-\s*(#{%w[else elsif rescue ensure when end].join('|')})\b/
# The Regex that matches a Doctype command.
DOCTYPE_REGEX = /(\d\.\d)?[\s]*([a-z]*)/i
DOCTYPE_REGEX = /(\d(?:\.\d)?)?[\s]*([a-z]*)/i
# The Regex that matches a literal string or symbol value
LITERAL_VALUE_REGEX = /:(\w*)|(["'])((?![\\#]|\2).|\\.)*\2/
@ -848,6 +848,8 @@ END
if xhtml?
if version == "1.1"
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
elsif version == "5"
'<!DOCTYPE html>'
else
case type
when "strict"; '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'

View file

@ -729,6 +729,7 @@ HAML
def test_doctypes
assert_equal('<!DOCTYPE html>',
render('!!!', :format => :html5).strip)
assert_equal('<!DOCTYPE html>', render('!!! 5').strip)
assert_equal('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
render('!!! strict').strip)
assert_equal('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',