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

Object tag is not detected as html #33

Closed
zippex opened this issue Feb 24, 2017 · 6 comments
Closed

Object tag is not detected as html #33

zippex opened this issue Feb 24, 2017 · 6 comments

Comments

@zippex
Copy link

zippex commented Feb 24, 2017

Hi Alex,

I'm using emojis which are included with an <object> tag. For some reason anchorme does not detect this as html and does mistakenly process the url within the data attribute.

Lorem ipsum <object class="emoji" data="https://www.mydomain.com/svg/emoji/123.svg" type="image/svg+xml" standby=":)">:)</object>

I suppose it has something to do with data="https... because when I change it to src="https..., the <object> tag will be recognized and not break any more - but of course then the emoji will not show up.

Thanks in advance for any help :)

@alexcorvi alexcorvi mentioned this issue Feb 26, 2017
@alexcorvi
Copy link
Owner

Fixed in 1.0.0, please update, no breaking changes introduced. It's just faster with few minor bugs fixes.

@zippex
Copy link
Author

zippex commented Feb 26, 2017

Great, thank you for your fast response! It's working :)

@zippex
Copy link
Author

zippex commented Feb 26, 2017

Sorry, but I think I've stumbled upon a related issue. The <object> tag is now working but when I try to build my vendor files for production with Webpack2 and UglifyJs, the new version of anchorme causes this error:

ERROR  Failed to compile with 1 errors

\js/vendor.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [./~/anchorme/dist-node/separate/fix.js:34,0][\js/vendor.js:35063,26]

Line 35063 in my vendor file is pointing to line 34 in your fix.js:
https://github.com/alexcorvi/anchorme.js/blob/gh-pages/dist-node/separate/fix.js#L34

Yes, that totally make no sence, but I was not able to find what really breaks UglyfyJs. Do you have an idea?

@alexcorvi
Copy link
Owner

alexcorvi commented Feb 26, 2017

UglifyJS doesn't play very well with ES6, it's my bad though, I should have compiled to ES5 since this kind of issues is still expected from build tools.

I've released quick fix 1.0.1 and it should not generate such errors.

For future references, if you faced such issues with UglifyJS building other libraries, then you can transpile the source via babel or buble using their respective webpack loaders.

Please update and let me know if any error shows up.

@zippex
Copy link
Author

zippex commented Feb 28, 2017

Hi Alex,
sorry for my delay and yes, production build is now working with version 1.0.1 or 1.0.2.
So there is just one question left: how can I buy you a beer?

@alexcorvi
Copy link
Owner

Thanks 😃! I'm actually really grateful for these issue reports since I'm using this library on production.

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