While writing a script to fetch the number of commits in a given github repo, I encountered an issue.
The commit value was inside span tags.
<span class="num text-emphasized">
8
</span>
I used ZestAssignStringDelimiter, like this
{
"prefix": "<span class='num text-emphasized'>",
"postfix": "</span>",
"location": "BODY",
"variableName": "commits",
"index": 4,
"enabled": true,
"elementType": "ZestAssignStringDelimiters"
}
and got commits = ' 8 ', which isn't a number and ZestExpressionIsInteger fails to recognize it as an Integer.
When I try ZestExpressionEquals and compare it to '8', doesn't work.
I feel the need of a new property "trim", which would trim the left and right white-space around any string.
All the ZestAssign* statements could have this new property "trim" with Boolean value, default being false.
The above assignment statement would become,
{
"prefix": "<span class='num text-emphasized'>",
"postfix": "</span>",
"location": "BODY",
"variableName": "commits",
"trim": true,
"index": 4,
"enabled": true,
"elementType": "ZestAssignStringDelimiters"
}
Thoughts?
Is there any other way to achieve what I am trying to achieve?