-
Notifications
You must be signed in to change notification settings - Fork 0
/
answer.html
63 lines (49 loc) · 1.43 KB
/
answer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>题目识别</title>
<style type="text/css">
.wysihtml5-sandbox {
border: 1px solid #ccc !important;
}
</style>
</head>
<body>
<div class="container">
<div class="row-fluid">
<div class="tab-content">
<textarea style="width:100%" rows="16" id="text-area"></textarea>
</div>
<button id="check-textarea" class="btn-primary btn-block">
开始识别
</button>
<div id="preview_1">
</div>
<div id="preview_2">
</div>
</div>
<footer>
</footer>
</div> <!-- /container -->
<script src="./lib/jquery-1.11.0.min.js"></script>
<script>
(function() {
$('#check-textarea').click(function(event) {
var content = $('#text-area').val();
console.log($('#text-area').html());
var end_content = start(content);
$('#preview_1').html(start(content));
});
function start(content){
console.log(content);
var match = new Array();
match = content.match(/\s[\s\(_(]+\d+[\s\)_)]+|_[_0-9\(\)]+|\d+[\.\s]*_+|\s[\s]+\s|-+\W*\d\W*-+|\d+[、\s]*_+/)
if(match){
var content = content.replace(/\s[\s\(_(]+\d+[\s\)_)]+|_[_0-9\(\)]+|\d+[\.\s]*_+|\s[\s]+\s|-+\W*\d\W*-+|\d+[、\s]*_+/,'<font color="red">--题目--</font>');
return start(content);
}else{
return content;
}
}
})();
</script>
</body></html>