sugar-high 0.0.6 → 0.0.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.
Files changed (2) hide show
  1. package/lib/index.mjs +2 -2
  2. package/package.json +1 -1
package/lib/index.mjs CHANGED
@@ -206,7 +206,7 @@ export function tokenize(code) {
206
206
  const next = code[i + 1]
207
207
  const c_n = curr + next // current and next
208
208
  const p_c = prev + curr // previous and current
209
- const isJsxLiterals = jsx.child && !jsx.expr
209
+ const isJsxLiterals = !jsx.tag && jsx.child && !jsx.expr
210
210
 
211
211
  if (jsx.tag) {
212
212
  const isOpenElementEnd = curr === '>'
@@ -288,7 +288,7 @@ export function tokenize(code) {
288
288
  } else {
289
289
  append()
290
290
  current = curr
291
- if (c_n === '</') {
291
+ if (c_n === '</' || c_n === '/>') {
292
292
  current = c_n
293
293
  append()
294
294
  i++
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sugar-high",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "exports": "./lib/index.mjs",
6
6
  "description": "Super lightweight JSX syntax highlighter",