-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Make it possible to temporarily override output method when calling _IncrementalWriter.write #210
Conversation
See a bit further up in the file, there is a helper function for this:
Seems like a nice feature. I'd like to see a bit of documentation added, though, and a test for what the different output methods do in this context. |
…IncrementalWriter.write
Just added tests. If you like it so far, I can add some docs as well. Where do you think we should talk about this? |
According to https://developers.google.com/web/fundamentals/getting-started/primers/customelements custom elements must contain a dash in tag names. Shold we maybe make this automatic for elements with dash in them? |
Hmmm, that'd be a bad idea. .write() call would have to go through the entire tree to see whether there are any tags with dash in them. never mind :) |
Looks good so far. I think that extending the docstring would be enough. The problem with the HTML attributes that you showed is because the serialisation is done manually directly in the writer, and it doesn't actually know about HTML. I agree that it should be fixed, but I'm not sure how exactly this should be done. |
Done. Anything else?
I think it'd be possible to add the method argument to Whether we should add missing void elements to that list and introduce another incompatibility with what libxml does is a decision you will need to make. |
I think that's a discussion for another issue. |
Agreed. Thanks for your contribution. |
Behold:
With custom elements, HTML is no more a tag soup of predefined tag names. As can be seen in: https://user-content-dot-custom-elements.appspot.com/PolymerElements/paper-dropdown-menu/v1.4.2/paper-dropdown-menu/demo/index.html we may need to have the value of the
selected
attribute.My solution to this is the ability to override the output method temporarily in write calls.
Stefan, If the patch is as simple as this, could you advise about the actual value to pass to write() when overriding method?
Thanks & best regards