hanspell 0.9.5 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,6 +78,8 @@ function spellCheck(sentence, timeout, check, end, error) {
78
78
  return;
79
79
  }
80
80
 
81
+ // Removes HTML tags.
82
+ sentence = sentence.replace(/<[^ㄱ-ㅎㅏ-ㅣ가-힣>]+>/g, '');
81
83
  const data = split(sentence, '.,\n', DAUM_MAX_CHARS);
82
84
  let count = data.length;
83
85
 
@@ -23,8 +23,10 @@ function parseJSON(response) {
23
23
  }
24
24
  const info = pnutypo.help
25
25
  .replace(/< *[bB][rR] *\/>/g, '\n')
26
- .replace(/\n\n/, '\n')
27
- .replace(/\n\(예\) /, '\n(예)\n');
26
+ .replace(/\n\n/g, '\n')
27
+ .replace(/\n\(예\) /g, '\n(예)\n')
28
+ .replace(/ \(예\) /g, '\n(예)\n')
29
+ .replace(/ */g, '\n');
28
30
 
29
31
  return {
30
32
  token: decode(pnutypo.orgStr),
@@ -60,6 +62,8 @@ function spellCheck(sentence, timeout, check, end, error) {
60
62
  return;
61
63
  }
62
64
 
65
+ // Removes HTML tags.
66
+ sentence = sentence.replace(/<[^ㄱ-ㅎㅏ-ㅣ가-힣>]+>/g, '');
63
67
  // Due to PNU server's weird behavior, replaces '\n' to '\n '.
64
68
  const data = split(
65
69
  `${sentence.replace(/([^\r])\n/g, '$1\r\n')}\r\n`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hanspell",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "description": "(주)다음과 부산대학교 인공지능연구실/(주)나라인포테크의 온라인 서비스를 이용한 한글 맞춤법 검사기.",
5
5
  "homepage": "https://github.com/9beach/hanspell",
6
6
  "author": {