Add option to disable autoScriptToLang on certain elements if wanted

Offen
#1,817 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 5 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
32/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
php
Bereich
backend

Rechercherichtung

Start by reproducing the split with the sample markup and the autoScriptToLang setting enabled, and check where the output adds lang spans around text inside the td and div elements. The issue sketches a disableAutoScriptToLang attribute that children inherit, but the attribute name and inheritance rules are still open, so settle them with maintainers first. Done means the marked element keeps its text unsplit while unmarked text is still processed.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Having autoScriptToLang globally is quite a fine function, but for some elements in the document, it might be a need to have only one language set for it so proper font is used and no language determination is done.

Example:

<body>
  <table>
    <tr>
      <td lang="ja">ンターJA健康ー康</td>
    </tr>
  </table>
  <div>Hello 健康</div>
</body>

Currently, it's split into something like:

<body>
  <table>
    <tr>
      <td lang="ja"><span lang="ja">ンタ</span>ーJA<span lang="und-Hans">健康ー康</span></td>
    </tr>
  </table>
  <div>Hello <span lang="und-Hans">健康</span></div>
</body>

Where a more desired output would be:

<body>
  <table>
    <tr>
      <td lang="ja">ンターJA健康ー康</td>
    </tr>
  </table>
  <div>Hello <span lang="und-Hans">健康</span></div> <!-- process only this -->
</body>

I was thinking about some attribute on element level, e.g. disableAutoScriptToLang which will be taken into the account only if autoScriptToLang is set to true in mpdf configuration. It might work also on hierarchy level, so it means that this attribute will apply to all children elements too. In HTML template it might look like:

<body>
  <table>
    <tr>
      <td lang="ja" disableAutoScriptToLang>ンターJA健康ー康</td>
    </tr>
  </table>
  <div>Hello 健康</div>
</body>
Vorherrschende Sprache
PHP
Sterne
4.7k
Forks
1.1k
Ø Merge
6 T. 11 Std.
Gemergte PRs (30 T.)
4

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus mpdf/mpdf

Alle Issues in mpdf/mpdf

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.