Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

FIX regexp #100

Closed
wants to merge 1 commit into from
Closed

FIX regexp #100

wants to merge 1 commit into from

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Oct 17, 2014

The regexp being used fails if the datatable is not initialised with empty data.

When the table is empty, we try to match an expression that looks like this :
<!-- ngRepeat: v in a.b --><!-- end ngRepeat: v in a.b -->

ngRepeatAttr is then correctly matched to a.b

When the table is NOT empty, then the expression looks more like this :
<!-- ngRepeat: v in a.b --><tr ng-repeat="v in a.b" class="ng-scope">...

ngRepeatAttr is then set to a.b" (with a quote at the end of the expression)

We should use a .+? as a non-greedy version of .+ to match only the expression inside the comment

The regexp being used fails if the datatable is not initialised with empty data.

When the table is empty, we try to match an expression that looks like this :
`<!-- ngRepeat: v in a.b --><!-- end ngRepeat: v in a.b -->`

ngRepeatAttr is then correctly matched to `a.b`

When the table is NOT empty, then the expression looks more like this :
`<!-- ngRepeat: v in a.b --><tr ng-repeat="v in a.b" class="ng-scope">...`

ngRepeatAttr is then set to `a.b"` (with a quote at the end of the expression)

We should use a `.+?` as a non-greedy version of `.+` to match only the expression inside the comment
l-lin added a commit that referenced this pull request Oct 17, 2014
@l-lin
Copy link
Owner

l-lin commented Oct 17, 2014

Awesome! 👍

@l-lin l-lin closed this Oct 17, 2014
@l-lin l-lin added the bug label Oct 17, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants