Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
fix group name with parenthesis causing scrollspy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Apr 30, 2023
1 parent 3e0d7a5 commit e19e4c1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# apiDoc Changelog

### 1.0.2

* Fix group name with parenthesis causing scrollspy error

### 1.0.1

* fix version number
Expand Down
3 changes: 2 additions & 1 deletion lib/core/workers/api_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ function postProcess (parsedFiles, filenames, preProcess, packageInfos, source,

// replace invalid chars for id attribute
const urlSafeUTF8 = /[^-_.~\p{L}\p{N}\p{M}\p{P}\p{S}\p{Z}\p{C}]+/gu;
group = group.replace(urlSafeUTF8, '');
// also remove parenthesis as they mess with scrollspy.js
group = group.replace(urlSafeUTF8, '').replace(/(\(|\))/g, '');

block.local[target] = group;
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apidoc",
"version": "1.0.1",
"version": "1.0.2",
"description": "RESTful web API Documentation Generator",
"author": "Peter Rottmann <rottmann@inveris.de>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion test/core/worker_api_group_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Worker: apiGroup', function () {

const rootBlock = parsedFiles[0][0];

assert.strictEqual(rootBlock.local.group, 'Category_(official)');
assert.strictEqual(rootBlock.local.group, 'Category_official');
assert.strictEqual(rootBlock.local.groupTitle, 'Category_(official)');

done();
Expand Down

0 comments on commit e19e4c1

Please sign in to comment.