Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Parse language information #3
After discussion on IRC, opening an issue here for the language parsing brainstorming that's happened on the wiki:
This is worth digging into for examples and variations on use of the
Here's a clear example that shows some of the "gotchas":
Bad example: <a lang="es" title="Spanish" href="qa-html-language-declarations.es">Español</a>
Good example: <span title="Spanish"><a lang="es" href="qa-html-language-declarations.es">Español</a></span>
Hope that's helpful. It's research I was doing while discussing w3c/webmention#57
Seems like it could be improved with:
Assuming that the document at "qa-html-language-declarations.es" is also in Spanish.
@tantek could you code "fence" those so the markup's viewable?
What I'm seeing in the console, though, does clarify the URL's meaning, but doesn't deal with
<html lang="en"> ... Bestest(?) example: <a title="Not actually in Spanish" hreflang="jp" href="http://example.jp/" lang="es">Español</a> ... </html>
That covers all the cases I know of...right now...today.
php-mf2 supports this behind a feature flag as of 0.3.2 https://github.com/indieweb/php-mf2/releases/tag/v0.3.2
microformat-shiv supports this as of 2.0 glennjones/microformat-shiv#22
Still pending confirmation from a consumer that this gives the expected result / no issues.