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

Added type="button" to <button>s without any type #23866

Merged
merged 1 commit into from
Oct 3, 2017

Conversation

Herst
Copy link
Contributor

@Herst Herst commented Sep 7, 2017

https://github.com/twbs/bootlint/wiki/W007

Found as part of my work on bootlint for BS4: twbs/bootlint#410.

I created the following one-liner to do it:

find docs/ -type f -exec perl -pi -e \
  's/(?<=<button )(.*?)(?=>)/@{[(index($1,"type=")!=-1?"$1":"type=\"button\" $1")]}/g' {} +

BTW, I am occasionally rebasing my patch branches so you shouldn't need to merge the current HEAD of v4-dev into my patch.

@Herst Herst force-pushed the no-button-without-type branch 2 times, most recently from db58f2f to 9932871 Compare September 12, 2017 22:50
@patrickhlauke
Copy link
Member

patrickhlauke commented Sep 12, 2017

a type-less button is fine unless it's in a form. not completely sold on this PR being necessary, but not overly fussed.

@XhmikosR
Copy link
Member

I think this is a nice change for the reasons mentioned in the bootlint Wiki page.

@Herst Herst force-pushed the no-button-without-type branch 3 times, most recently from e6b4d19 to 73ada66 Compare September 16, 2017 23:51
@XhmikosR XhmikosR requested a review from mdo September 17, 2017 08:14
@Herst Herst force-pushed the no-button-without-type branch 4 times, most recently from 09cc781 to 69b622f Compare September 24, 2017 11:15
@Herst Herst force-pushed the no-button-without-type branch from 69b622f to d78b99f Compare September 24, 2017 20:45
@Herst
Copy link
Contributor Author

Herst commented Sep 25, 2017

I just noticed that my changes are incompatible with the attribute order as propagated by http://codeguide.co/#html-attribute-order but then there are numerous examples in the docs where this is the case. Should I change it?

BTW, I believe there are automated tools which can be used to enforce this.

@Herst Herst force-pushed the no-button-without-type branch 4 times, most recently from e1ecbed to 3486b58 Compare October 1, 2017 09:23
@Herst Herst force-pushed the no-button-without-type branch from 3486b58 to 2eb02a5 Compare October 2, 2017 22:12
@mdo mdo merged commit aae11ab into twbs:v4-dev Oct 3, 2017
@Herst Herst deleted the no-button-without-type branch October 20, 2017 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants