Add option to disable autoScriptToLang on certain elements if wanted

Aberta
#1,817 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 5 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
32/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
php
Domínio
backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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>
Linguagem predominante
PHP
Estrelas
4.7k
Forks
1.1k
Merge médio
6d 11h
PRs com merge (30d)
4

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de mpdf/mpdf

Todas as issues de mpdf/mpdf

Issues semelhantes

Mais issues de PHP

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.