mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Implement unicode line-breaking
This commit is contained in:
40
tests/reftests/text/line-break.html
Normal file
40
tests/reftests/text/line-break.html
Normal file
@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>word-break</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script type="text/javascript" src="../../test.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial;
|
||||
}
|
||||
.test span {
|
||||
line-break: normal;
|
||||
}
|
||||
|
||||
.strict span {
|
||||
line-break: strict;
|
||||
}
|
||||
p.test{
|
||||
border: 1px solid gray;
|
||||
color: blue;
|
||||
width: 6em;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<!-- iteration marks -->
|
||||
<p class="test" lang="ja">
|
||||
<span>サンプルぁルぁルぁルぁルぁルぁルぁぁぁぁ文ンプル–文々サンプル文</span>
|
||||
</p>
|
||||
|
||||
<p class="test strict" lang="ja">
|
||||
<span>サンプルぁルぁルぁルぁルぁルぁルぁぁぁぁ文文文文文‐–〜゠サンプル文々サンプル文</span>
|
||||
</p>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
</body>
|
||||
</html>
|
58
tests/reftests/text/overflow-wrap.html
Normal file
58
tests/reftests/text/overflow-wrap.html
Normal file
@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>word-break</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script type="text/javascript" src="../../test.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial;
|
||||
}
|
||||
.normal {
|
||||
width: 13em;
|
||||
background: gold;
|
||||
overflow-wrap: normal;
|
||||
}
|
||||
|
||||
.break-word {
|
||||
width: 13em;
|
||||
background: lime;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.word-normal {
|
||||
width: 13em;
|
||||
background: gold;
|
||||
word-wrap: normal;
|
||||
}
|
||||
|
||||
.word-break-word {
|
||||
width: 13em;
|
||||
background: lime;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<p>1. <code>overflow-wrap: normal</code></p>
|
||||
<p class="normal">FStrPrivFinÄndG (Gesetz zur Änderung des
|
||||
Fernstraßenbauprivatfinanzierungsgesetzes
|
||||
und straßenverkehrsrechtlicher Vorschriften)</p>
|
||||
<p>2. <code>overflow-wrap: break-word</code></p>
|
||||
<p class="break-word">FStrPrivFinÄndG (Gesetz zur Änderung des
|
||||
Fernstraßenbauprivatfinanzierungsgesetzes
|
||||
und straßenverkehrsrechtlicher Vorschriften)</p>
|
||||
<p>3. <code>word-wrap: normal</code></p>
|
||||
<p class="word-normal">FStrPrivFinÄndG (Gesetz zur Änderung des
|
||||
Fernstraßenbauprivatfinanzierungsgesetzes
|
||||
und straßenverkehrsrechtlicher Vorschriften)</p>
|
||||
<p>4. <code>word-wrap: break-word</code></p>
|
||||
<p class="word-break-word">FStrPrivFinÄndG (Gesetz zur Änderung des
|
||||
Fernstraßenbauprivatfinanzierungsgesetzes
|
||||
und straßenverkehrsrechtlicher Vorschriften)</p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
50
tests/reftests/text/word-break.html
Normal file
50
tests/reftests/text/word-break.html
Normal file
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>word-break</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script type="text/javascript" src="../../test.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial;
|
||||
}
|
||||
.narrow {
|
||||
padding: 5px;
|
||||
border: 1px solid;
|
||||
width: 8em;
|
||||
}
|
||||
|
||||
.normal {
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.breakAll {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.keep {
|
||||
word-break: keep-all;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<p>1. <code>word-break: normal</code></p>
|
||||
<p class="normal narrow">This is a long and
|
||||
Supercalifragilisticexpialidocious sentence.
|
||||
次の単語グレートブリテンおよび北アイルランド連合王国で本当に大きな言葉</p>
|
||||
|
||||
<p>2. <code>word-break: break-all</code></p>
|
||||
<p class="breakAll narrow">This is a long and
|
||||
Supercalifragilisticexpialidocious sentence.
|
||||
次の単語グレートブリテンおよび北アイルランド連合王国で本当に大きな言葉</p>
|
||||
|
||||
<p>3. <code>word-break: keep-all</code></p>
|
||||
<p class="keep narrow">This is a long and
|
||||
Supercalifragilisticexpialidocious sentence.
|
||||
次の単語グレートブリテンおよび北アイルランド連合王国で本当に大きな言葉</p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user