slime-lang / slime

Minimalistic HTML templates for Elixir, inspired by Slim.
http://slime-lang.com
MIT License
371 stars 57 forks source link

Getting an error when leaving a space between `doctype` and `html` #160

Closed lobo-tuerto closed 4 years ago

lobo-tuerto commented 4 years ago

Hello, I'm just trying out Slime and while converting my app.html.eex file I found out that if I write this:

doctype html

html

I get an error like:

Compiling 1 file (.ex)

== Compilation error in file lib/rumbl_web/views/layout_view.ex ==
** (Slime.TemplateSyntaxError) Unexpected symbol '
'
INPUT, Line 2, Column 1

Notice the empty line between doctype and html. If I remove the space everything is ok.

It also works like this:

doctype html
|
html

Is there any particular reason why an empty line is not allowed between the doctype and html tags?

Rakoth commented 4 years ago

Hi, @lobo-tuerto, thanks for the report, sounds like a bug to me. Would you like to created a PR and try to fix it?

lobo-tuerto commented 4 years ago

@Rakoth Sure, I'll take a look and take a stab at it. :)

lobo-tuerto commented 4 years ago

@Rakoth Got a PR for this issue ready to be reviewed here: https://github.com/slime-lang/slime/pull/161 :)

Rakoth commented 4 years ago

Fixed by #161