HamlPy icon indicating copy to clipboard operation
HamlPy copied to clipboard

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

Open akiran opened this issue 12 years ago • 2 comments

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 avatar Jun 05 '13 06:06 akiran

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+)?)?

akiran avatar Jun 05 '13 08:06 akiran

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.

gak avatar Nov 03 '13 05:11 gak