Skip to content

Markup the article language #240

@Marrin

Description

@Marrin

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions