-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix: image tag format throw error #73
Conversation
Hi @xiaomingplus the PR looks good except that the code isn't formatted with prettier and you didn't add any tests. |
hello, @StarpTech ,I thought about it for a moment, image should really be treated as an void element instead of a custom element. so,I recommit a pr for adding Can you review this? thanks. |
@xiaomingplus We should handle it as a custom element because (quote below) and the fact that the tag is
|
Ok,I agree it,I'll give a pull request for that |
@xiaomingplus I also double check it. The browsers will replace |
Actually,I use vue for weex(a react native like but using vue) development Weex provide a image component, https://weex.apache.org/references/components/image.html So,treat |
@xiaomingplus for me it looks like that weex is no real html framework. The markup won't reach a native browser.
Therefore I don't want to support it in first instance. This is an important info:
Try this in prettyhtml, it behaves correctly: <svg>
<image src="http://google.com"></image>
</svg>
<image src="http://google.com"></image> output <svg>
<image src="http://google.com"></image>
</svg>
<image src="http://google.com"> Finally there is no change needed. |
But I will prepare a fix so that no invalid markup is generated. |
but,if you include your output in input : <div>
<svg>
<image src="http://google.com"></image>
</svg>
<image src="http://google.com">
</div> it throw a error. I think you can merge the pull request simply. :) |
Hi @xiaomingplus indeed the PR looks good I've worked on the same solution. I missing some test I will add them to the PR. |
Thanks~ |
fix #72
Hi,I don't think image should a valid tag in html, so I remove the void tag from html-void-elements.
here are the expected examples:
input:
output:
or,input:
output:
or ,input :
output: