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

Fix svg detection when it starts with a comment #193

Merged
merged 4 commits into from
Dec 14, 2021

Conversation

vitorduarte
Copy link
Contributor

Fixes #192

@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.429% when pulling fd994ec on vitorduarte:master into 2163896 on gabriel-vasile:master.

@gabriel-vasile
Copy link
Owner

Hi @vitorduarte

There is a problem with this solution. It does not work for HTML files with SVGs embedded into them.

@vitorduarte
Copy link
Contributor Author

Hello @gabriel-vasile

I was thinking what should be the best solution for it. The problem on detection of SVG files with comments happened because the "<!--" is detected first on HTML detector.

What could be the issues of remove its detector, as described on code bellow?

	Html = markup(
		[]byte("<!DOCTYPE HTML"),
		[]byte("<HTML"),
		[]byte("<HEAD"),
		[]byte("<SCRIPT"),
		[]byte("<IFRAME"),
		[]byte("<H1"),
		[]byte("<DIV"),
		[]byte("<FONT"),
		[]byte("<TABLE"),
		[]byte("<A"),
		[]byte("<STYLE"),
		[]byte("<TITLE"),
		[]byte("<B"),
		[]byte("<BODY"),
		[]byte("<BR"),
		[]byte("<P")
	)

Copy link
Owner

@gabriel-vasile gabriel-vasile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thank you for your contribution

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

Successfully merging this pull request may close these issues.

SVG detection fails for SVGs starting with a comment
3 participants