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

Unable to handle complex html tags with underscore and hyphens inside the tag name #136

Open
akiran opened this issue Jun 5, 2013 · 2 comments

Comments

@akiran
Copy link

akiran commented Jun 5, 2013

Hi,

I am trying to use hamlpy for an web app with django and Angularjs.
Angularjs introduces html tags with hyphen in tag name. Ex: ng-view
hamlpy is compiling
%ng-view
as
-view
but, the expected result is

Ruby Haml is handling these tags properly, hamlpy seems to have a bug.

@akiran
Copy link
Author

akiran commented Jun 5, 2013

I temporarily got around this problem by changing the tag regular expression in HAML_REGEX of hamlpy.elements module
old tag regex: (?P%\w+(:\w+)?)?
changed tag regex: (?P%\w+(-\w+)?(:\w+)?)?

@gak
Copy link

gak commented Nov 3, 2013

I'm having this issue too. An alternative fix is to just use HTML. e.g:

  .col-md-4
    %div{ng-controller: 'StatsController'}
      <my-visualization val="data"></my-visualization>

From a bug point of view, I think the fix by @akiran should be included in the code, as it's a valid tag name.

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

No branches or pull requests

2 participants