@ng-doc/utils 16.9.0 → 16.11.0

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/index.js +8 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -14818,9 +14818,9 @@ function keywordsPlugin(config) {
14818
14818
  * @param config
14819
14819
  */
14820
14820
  function getNodes(node, parent, inlineLink, config) {
14821
- const regexp = '([*A-Za-z0-9_$@]+[.#]?[A-Za-z0-9_-]+)';
14821
+ const regexp = '([*A-Za-z0-9_$@]+[.#]?[A-Za-z0-9_-]+(?:\\?.+)?)';
14822
14822
  const KeywordRegExp = inlineLink ? new RegExp(`^${regexp}$`, 'g') : new RegExp(regexp, 'g');
14823
- const keywordAnchorRegexp = /^(?<keyword>[*A-Za-z0-9_$@]+)((?<delimiter>[.#])(?<anchor>[A-Za-z0-9_-]+))?$/;
14823
+ const keywordAnchorRegexp = /^(?<keyword>[*A-Za-z0-9_$@]+)((?<delimiter>[.#])(?<anchor>[A-Za-z0-9_-]+))?(?<queryParams>(?:\?.+))?$/;
14824
14824
  const {
14825
14825
  addUsedKeyword,
14826
14826
  addPotentialKeyword,
@@ -14831,13 +14831,14 @@ function getNodes(node, parent, inlineLink, config) {
14831
14831
  throw new Error('Missing config');
14832
14832
  }
14833
14833
  return toString(node).split(KeywordRegExp).filter(word => word.length).map(word => {
14834
+ const pureKeyword = word.split('?')[0];
14834
14835
  const match = word.match(keywordAnchorRegexp);
14835
- const keyword = getKeyword(word);
14836
+ const keyword = getKeyword(pureKeyword);
14836
14837
  const rootKeyword = getKeyword(match?.groups?.['keyword'] || '');
14837
- if (keywordAnchorRegexp.test(word)) {
14838
- keyword ? addUsedKeyword(word) : addPotentialKeyword(word);
14838
+ if (keywordAnchorRegexp.test(pureKeyword)) {
14839
+ keyword ? addUsedKeyword(pureKeyword) : addPotentialKeyword(pureKeyword);
14839
14840
  }
14840
- const notFoundGuideKeyword = /^\*\w+/gm.test(word) && !keyword;
14841
+ const notFoundGuideKeyword = /^\*\w+/gm.test(pureKeyword) && !keyword;
14841
14842
  const notFoundApiKeyword = !!rootKeyword && !!match?.groups?.['anchor'] && !keyword;
14842
14843
  if (inlineLink && (notFoundGuideKeyword || notFoundApiKeyword)) {
14843
14844
  raiseError(new Error(`Route with keyword "${word}" is missing.`));
@@ -14846,7 +14847,7 @@ function getNodes(node, parent, inlineLink, config) {
14846
14847
  if (inlineLink && keyword?.isCodeLink === false) {
14847
14848
  parent.tagName = 'a';
14848
14849
  parent.properties = {
14849
- href: keyword.path
14850
+ href: `${keyword.path}${match?.groups?.['queryParams'] ?? ''}`
14850
14851
  };
14851
14852
  return {
14852
14853
  type: 'text',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-doc/utils",
3
- "version": "16.9.0",
3
+ "version": "16.11.0",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "rehype": "12.0.1",