Add option to disable autoScriptToLang on certain elements if wanted
Maintainers usually reply within 5 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 32/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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>
- Dominant language
- PHP
- Stars
- 4.7k
- Forks
- 1.1k
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mpdf/mpdf
-
SVG path arcs with an explicit zero radius throw DivisionByZeroErrorPossibly taken @Syed-Shehroz-Sohail claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 5 days
-
Closing a column set with an image in it leaves the cursor below the page, wasting the rest of itOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 5 days
-
8.3: Local fallback for external stylesheets is inverted in CssLoader (basepathIsLocal check negated) — CSS silently dropped when remote fetch failsPossibly taken @hemreduru claimed this 12 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 5 days
-
Tag/Td.php silently clears cell top/bottom borders when a row has a partial border (plus two warnings and a deprecation)Possibly taken @alizamani1616 claimed this 61 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 5 days
-
AdjustHTML() collapses multiple spaces inside quoted attribute values (src, href)Possibly taken @sornapudisuresh claimed this 130 days ago. Openbug/fix help wanted HTML/CSS support
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 5 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Перевод устарел
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day