Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Itemscope itemtype error #66

Closed
jacmoe opened this issue Mar 7, 2016 · 8 comments
Closed

Itemscope itemtype error #66

jacmoe opened this issue Mar 7, 2016 · 8 comments
Labels

Comments

@jacmoe
Copy link
Contributor

jacmoe commented Mar 7, 2016

With this:

.blogentry(itemscope itemtype="http://schema.org/BlogPosting")

I get this:

Failed to lex jade: Unclosed attribute block (Line: 2, Offset: 21)

Any pointers?

@jacmoe
Copy link
Contributor Author

jacmoe commented Mar 7, 2016

So, I tried this:

.blogentry(itemscope="itemscope" itemtype="http://schema.org/BlogPosting")

And the error goes away, but it renders like this:

<div class="blogentry" itemscope="itemscope" itemtype="http://schema.org/BlogPosting"></div>

I suspect that Jade will render it correctly by default, from reading this SO post:
http://stackoverflow.com/questions/11020142/jade-element-attributes-without-value

Edit:
And it does indeed.

I tried to enter the original line into the Jade online demo, and it does the right thing.

<div class="blogentry" itemscope itemtype="http://schema.org/BlogPosting"></div>

So, I think that Tale Jade should handle a line like this:

.blogentry(itemscope itemtype="http://schema.org/BlogPosting")

@jacmoe jacmoe changed the title Itemtype itemscope error Itemscope itemtype error Mar 7, 2016
@TorbenKoehn
Copy link
Member

This should be fixed with the new lexer scanners and re-written scanning algorithms that work more consistent and stable.

I'll get the update up as soon as possible.

@TorbenKoehn TorbenKoehn added the bug label Mar 9, 2016
@TorbenKoehn
Copy link
Member

Checked it again.

This is a bug.
http://sandbox.jade.talesoft.io/id-56e159b37bbbb.html

Without a ,, it won't even render correctly.

As said above, I've completely re-written attribute parsing in the new branches.
I'll try to get the update up today, I don't know if I make it (Compiler still needs a lot of work)

@jacmoe
Copy link
Contributor Author

jacmoe commented Mar 10, 2016

Take your time 👍

I am not in dire need.
Looking forward to it, though. :)

@TorbenKoehn
Copy link
Member

Well, you can always get around it by using plain HTML :)

Any line starting with < is handled as plain HTML by Tale Jade (and official Jade)!

@jacmoe
Copy link
Contributor Author

jacmoe commented Mar 10, 2016

Well, you can always get around it by using plain HTML :)

That is too easy @TorbenKoehn :)

But thanks for reminding me - I was not aware of that 👍

TorbenKoehn pushed a commit that referenced this issue Apr 7, 2016
- Cleaned up dev-dependencies
- Now using PSR2 fully over the whole project.
- tale-config is now used in version 0.2 (PSR-2)
- Fixed a bug with name-only attributes separated with spaces (#66)
- HTML5-mode now doesn't self-close attributes at all (#66)
- The lexer now prints a little piece of jade code to find errors faster
- Fixed a bug regarding IE conditional comments and interpolation
- Added composer.lock to prevent stuff like the reason for 1.4.1.
TorbenKoehn added a commit that referenced this issue Apr 7, 2016
* PSR-2 overhaul, bugfixes

- Cleaned up dev-dependencies
- Now using PSR2 fully over the whole project.
- tale-config is now used in version 0.2 (PSR-2)
- Fixed a bug with name-only attributes separated with spaces (#66)
- HTML5-mode now doesn't self-close attributes at all (#66)
- The lexer now prints a little piece of jade code to find errors faster
- Fixed a bug regarding IE conditional comments and interpolation
- Added composer.lock to prevent stuff like the reason for 1.4.1.

* Fixed a test

Make sure that compiler doesn't echo XML doctypes in tests when running
in HHVM.
@TorbenKoehn
Copy link
Member

Some love for you, my friend. Can you test it?

@jacmoe
Copy link
Contributor Author

jacmoe commented Apr 7, 2016

It works wonderfully! Thanks 👍

@jacmoe jacmoe closed this as completed Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants