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

Unicode leftovers from convertBooleans() #84

Closed
bastjan opened this issue Nov 26, 2013 · 6 comments
Closed

Unicode leftovers from convertBooleans() #84

bastjan opened this issue Nov 26, 2013 · 6 comments

Comments

@bastjan
Copy link
Contributor

bastjan commented Nov 26, 2013

the replace regex from the method convertBooleans() (\s(\w+)='\u0093true') only finds attributes without dashes in it, so "test='true'" works, but "data-test='true'" does not. marked true/false don't get replaced and confuse some programmers because of the invisible unicode signs.

Possible Solution:
Replace regex so it accepts word characters and dashes:

\s([\w-]+)='\u0093true'

other possible solution:

strip all \u0093 before outputing them

@netzpirat
Copy link
Owner

Thanks for reporting. The first solution sounds simple, can you please make a pull request?

@bastjan
Copy link
Contributor Author

bastjan commented Nov 26, 2013

I'll do a pull request. I'm not sure if removing html5 data-* attributes is expected when they are false/true thou.

@netzpirat
Copy link
Owner

You're right, I think we should not touch the data attributes.

@bastjan
Copy link
Contributor Author

bastjan commented Nov 26, 2013

I'll try the second solution. it is not this hard either and should not break anything.

@bastjan
Copy link
Contributor Author

bastjan commented Nov 26, 2013

sticked with the first solution, now

- boolTrue = true
%input{data-test: boolTrue}

and

%input{data-test: true}

work the same way

@netzpirat
Copy link
Owner

Yes, makes absolutely sense to keep it consistent.

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