@markuplint/astro-parser 4.0.0-alpha.4 → 4.0.0-alpha.6

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 (3) hide show
  1. package/LICENSE +1 -1
  2. package/lib/parse.js +5 -5
  3. package/package.json +5 -5
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2019 Yusuke Hirao
3
+ Copyright (c) 2017-2023 Yusuke Hirao
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/lib/parse.js CHANGED
@@ -1,5 +1,5 @@
1
- import { parseRawTag, parse as htmlParse } from '@markuplint/html-parser';
2
- import { flattenNodes, detectElementType, getEndCol, getEndLine, sliceFragment, uuid } from '@markuplint/parser-utils';
1
+ import { parse as htmlParse } from '@markuplint/html-parser';
2
+ import { flattenNodes, detectElementType, getEndCol, getEndLine, sliceFragment, uuid, tagParser, } from '@markuplint/parser-utils';
3
3
  import { astroParse } from './astro-parser.js';
4
4
  import { attrTokenizer } from './attr-tokenizer.js';
5
5
  export const parse = (rawCode, options = {}) => {
@@ -269,12 +269,12 @@ nextNode, offset, options) {
269
269
  // childrenEnd,
270
270
  // });
271
271
  }
272
- const tagTokens = parseRawTag(startTagRaw, startLine, startCol, startOffset);
272
+ const tagTokens = tagParser(startTagRaw, startLine, startCol, startOffset);
273
273
  const tagName = tagTokens.tagName;
274
274
  let endTag = null;
275
275
  if (childrenEnd < (originNode.position.end?.offset ?? 0) + offset) {
276
276
  const endTagLoc = sliceFragment(rawHtml, childrenEnd, (originNode.position.end?.offset ?? 0) + offset);
277
- const endTagTokens = parseRawTag(endTagLoc.raw, endTagLoc.startLine, endTagLoc.startCol, endTagLoc.startOffset);
277
+ const endTagTokens = tagParser(endTagLoc.raw, endTagLoc.startLine, endTagLoc.startCol, endTagLoc.startOffset);
278
278
  const endTagName = endTagTokens.tagName;
279
279
  endTag = {
280
280
  uuid: uuid(),
@@ -321,7 +321,7 @@ nextNode, offset, options) {
321
321
  nextNode,
322
322
  pearNode: endTag,
323
323
  selfClosingSolidus: tagTokens.selfClosingSolidus,
324
- endSpace: tagTokens.endSpace,
324
+ endSpace: tagTokens.afterAttrSpaces,
325
325
  isFragment: false,
326
326
  isGhost: false,
327
327
  tagOpenChar: '<',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/astro-parser",
3
- "version": "4.0.0-alpha.4",
3
+ "version": "4.0.0-alpha.6",
4
4
  "description": "astro parser for markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -22,10 +22,10 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@astrojs/parser": "0.22.2",
25
- "@markuplint/html-parser": "4.0.0-alpha.4",
26
- "@markuplint/ml-ast": "4.0.0-alpha.4",
27
- "@markuplint/parser-utils": "4.0.0-alpha.4",
25
+ "@markuplint/html-parser": "4.0.0-alpha.6",
26
+ "@markuplint/ml-ast": "4.0.0-alpha.6",
27
+ "@markuplint/parser-utils": "4.0.0-alpha.6",
28
28
  "astro-eslint-parser": "^0.16.0"
29
29
  },
30
- "gitHead": "991b3aef77fde42c79343ee8c807257a35c589d7"
30
+ "gitHead": "06e1242d274c72cf08a10a572b06ac35d1b924a4"
31
31
  }