65 lines
2.5 KiB
HTML
65 lines
2.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||
"http://www.w3.org/TR/html4/strict.dtd">
|
||
<html lang="en">
|
||
<head>
|
||
<title>Hyphenator.js – Test 74</title>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<style type="text/css">
|
||
body {
|
||
width:50%;
|
||
margin-left:25%;
|
||
margin-right:25%;
|
||
}
|
||
#test1, #test2 {
|
||
background-color: #ffd6d6;
|
||
}
|
||
#ref1, #ref2 {
|
||
background-color: #d6ffd6;
|
||
}
|
||
</style>
|
||
<script src="../Hyphenator.js" type="text/javascript"></script>
|
||
<script type="text/javascript">
|
||
if (parent != window) {
|
||
Hyphenator.config({
|
||
'onhyphenationdonecallback': function () {
|
||
var i, last = 2, t1, t2, r = true,
|
||
desc = document.getElementById('desc').firstChild.data,
|
||
msg = {
|
||
desc: desc,
|
||
index: 74
|
||
};
|
||
for (i = 1; i <= last; i++) {
|
||
t1 = document.getElementById('test' + i).innerHTML;
|
||
t2 = document.getElementById('ref' + i).innerHTML;
|
||
r = r && (t1 == t2);
|
||
}
|
||
if (r) {
|
||
msg.result = 'passed';
|
||
} else {
|
||
msg.result = 'failed';
|
||
}
|
||
parent.postMessage(JSON.stringify(msg), window.location.href);
|
||
}
|
||
});
|
||
}
|
||
Hyphenator.config({
|
||
hyphenchar:'|',
|
||
minwordlength: 4,
|
||
safecopy: false
|
||
});
|
||
Hyphenator.run();
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<p><a href="index.html"><<- index</a> | <a href="test73.html"><- Prev</a> | <a href="test75.html">Next -></a></p>
|
||
<h1>Test 74</h1>
|
||
<p id="desc">Make use of additional information of the language tag (en-GB vs. en-US)</p>
|
||
|
||
<h2>en-GB</h2>
|
||
<p id="test1" class="hyphenate" lang="en-GB">color colour / A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
|
||
<p id="ref1" lang="en">color col|our / A hy|phen|a|tion al|gorithm is a set of rules that de|cides at which points a word can be broken over two lines with a hy|phen.</p>
|
||
<h2>en-US</h2>
|
||
<p id="test2" class="hyphenate" lang="en-US">color colour / A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
|
||
<p id="ref2" lang="en">color colour / A hy|phen|ation al|go|rithm is a set of rules that de|cides at which points a word can be bro|ken over two lines with a hy|phen.</p>
|
||
</body>
|
||
</html> |