Skip to content

Exclude heading anchors in translations #614

@lukasrad02

Description

@lukasrad02

#525 introduced permalinks to headings within a page, displayed by a # after the heading text. These links are added to the page in a way that they are also shown in the translation editor.

I.e., a heading # Beispiel that was previously shown as Beispiel in the translation editor will now be shown as Beispiel<a id="a1">#</a>.

This causes two problems:

  1. Every first sync of a page after the update causes all headings to not be translated, as the heading in the original language has changed from the perspective of the translation editor. This makes updates tedious, but at least only once per page.
  2. DeepL does not handle these kinds of links correctly, so machine translated headings look weird (see below).

Examples for bad link handling in automatic translations:
Example where the full heading has become the permalink
Example where one single word within the heading has become the permalink

In practice, this does not seem to be an issue, as the broken translations shown above are rendered correctly (the actual heading is not a link, there is no additional #, but the permalink-# is visible on hover) and one can even remove the anchor tag from the translated heading completely without removing the permalink from the rendered page.

Nevertheless, to avoid confusion and resolve the issue regarding the first sync of existing pages, it would be nice if we could remove the <a id="a1">#</a> part from the original headings in the translation editor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions