hanlint 0.0.13 → 0.0.14

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.
package/data/version.json CHANGED
@@ -1 +1 @@
1
- {"version": "0.0.13"}
1
+ {"version": "0.0.14"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hanlint",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "한국어 글 검사기. Korean prose linter for Markdown: translationese, noun piles, double passives, weak structure. Zero dependencies",
5
5
  "type": "module",
6
6
  "bin": {
@@ -88,6 +88,13 @@ function closingQuote(line, start) {
88
88
  return -1;
89
89
  }
90
90
 
91
+ /** `index` 의 `>` 가 JSX 여는 태그의 끝인가. 뜻은 파이썬 tagCloses 가 소유한다. @param {string} line @param {number} index */
92
+ function tagCloses(line, index) {
93
+ if (index === 0 || line[index + 1] === "=") return false;
94
+ const before = line[index - 1];
95
+ return "\"'}".includes(before) || /[A-Za-z0-9]/.test(before);
96
+ }
97
+
91
98
  /** 한 줄의 글 마디를 나온 차례로. 뜻은 파이썬 lineLiterals 가 소유한다. @param {string} line @returns {string[]} */
92
99
  export function lineLiterals(line) {
93
100
  /** @type {string[]} */
@@ -102,7 +109,7 @@ export function lineLiterals(line) {
102
109
  index = end + 1;
103
110
  continue;
104
111
  }
105
- if (char === ">" && (index === 0 || !"=-".includes(line[index - 1]))) {
112
+ if (char === ">" && tagCloses(line, index)) {
106
113
  const end = line.indexOf("<", index + 1);
107
114
  if (end > index) {
108
115
  const inner = line.slice(index + 1, end);