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

Markup the article language #240

Open
Marrin opened this issue Jul 27, 2023 · 0 comments
Open

Markup the article language #240

Marrin opened this issue Jul 27, 2023 · 0 comments

Comments

@Marrin
Copy link

Marrin commented Jul 27, 2023

Describe the feature

The <html> element has a lang attribute for the whole page/site but the blog post text doesn't have its own attribute. Which is fine if the blog post is in the language of the site, but it may break things if it is not.

For instance my blog is in English for all but one blog post which I marked as German (de) in the .. post:: directive. As Sphinx's basic.css allows the browser to automatically hyphenate text, the wrong rules for hyphenation are used in that German post.

Proposed solution

Extend the <div class="body" role="main"> with a lang attribute with the value given with :language: in the post, at least if it differs from the one in the <html> element.

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