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

. in element tag name throws error... #248

Closed
thomporter opened this issue Aug 31, 2014 · 4 comments
Closed

. in element tag name throws error... #248

thomporter opened this issue Aug 31, 2014 · 4 comments

Comments

@thomporter
Copy link

I'm working on a project built by angular-fullstack, which is using grunt-contrib-htmlmin, which in turn is using this module. I have integrated angular-paginate-anything and it works great, until I try to build my project, I get this error:

Running "ngtemplates:main" (ngtemplates) task
Warning: Parse Error: <begriffs.pagination
  ng-init="perPage=20"
  collection="logs"
  url="'/api/logs?user=-1'"
  per-page="perPage"
  per-page-presets="[10,20,50,100]"
  template-url="/assets/paginate-anything.html">
</begriffs.pagination>

The problem is with the "." in the tag name. I'm seeing other angular directives doing the same thing. Any way to make htmlmin accept this?

(I'm going to post an issue over on the paginate-anything repo as well, suggesting they change to a - instead of a .)

@duncanbeevers
Copy link
Collaborator

I haven't seen a . in a tag name before.

Can you share an example of a project using a . in a tag name in this way? Is it possible to simply use valid html tag names for your directives?

@thomporter
Copy link
Author

Here's the project: https://github.com/begriffs/angular-paginate-anything
They already had an open issue on the subject, and I added my 2¢:
begriffs/angular-paginate-anything#41

After reading some of the comments on the issue, I'm of a different opinion on the matter now. If lint is active, then htmlmin should not allow the dot. Otherwise, I suppose it should be allowed?

I didn't even think to try turning the lint option off to see if it would work before, and wouldn't have liked that option anyway. =) In fact, I had already renamed the directive in my project to "paginateit" and launched before I even posted the issue here. I just wanted to raise the awareness in both repos. 😉

@duncanbeevers
Copy link
Collaborator

Cool, thanks for the feedback. I don't think it's worthwhile changing the base behavior of the minifier to accommodate this nonconformant markup. The error message emitted seems pretty clear.

Thanks for chiming in on the issue in the angular-paginate-anything repo as well.

@alexlamsl
Copy link
Collaborator

So while XML would accept such a tag name, it is strictly forbidden in HTML5.

BTW, the project you've mentioned above has now moved away from using begriffs.pagination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants