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

Normalize HTML attributes #3

Open
Crissov opened this issue Oct 20, 2017 · 3 comments
Open

Normalize HTML attributes #3

Crissov opened this issue Oct 20, 2017 · 3 comments

Comments

@Crissov
Copy link
Contributor

Crissov commented Oct 20, 2017

It would be helpful if Babelmark canonically reordered generated HTML attributes so that implementations that only differed in this regard were shown collectively.

Example

![foo](bar "baz")

Most implementations generate

<img src="bar" alt="foo" title="baz">

but Rdiscount and Pandoc put title before alt:

<img src="bar" title="baz" alt="foo">

and Python-Markdown puts alt first.

<img alt="foo" src="bar" title="baz">
@xoofx
Copy link
Member

xoofx commented Oct 20, 2017

Indeed. Don't know when I can work on this but I will keep it around. thanks

@Crissov
Copy link
Contributor Author

Crissov commented Oct 10, 2018

Add to this: ignore custom data-* attributes (e. g. Github) and possibly ids and classes (e.g. headings and footnotes).

@Crissov Crissov changed the title Normalize HTML attribute order Normalize HTML attributes Oct 10, 2018
@Crissov
Copy link
Contributor Author

Crissov commented Oct 11, 2018

I've looked into the JS to find out where you normalize the HTML until I finally figured out that this is done on the babelmark-proxy server-side already, i.e. the JSON returned by the Azure server, e.g. for https://babelmark.azurewebsites.net/api/get?text=foo, already includes an html_safe string for each queried service.

NUglify does not seem to support reordering attributes or removing data-*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants