Skip to content

Commit

Permalink
Listings - Improve list.js special character handling
Browse files Browse the repository at this point in the history
Taken from: javve/list.js#699

Since regex searching isnt used any longer, this escaping isn’t necessary, but it hasn’t been fixed upstream.

Fixes #8435

I believe that the searching is fuzzy, so the `-` doesn’t really provide very functional search filtering. (though other examples like ? are more functional)
  • Loading branch information
dragonstyle committed Jan 25, 2024
1 parent 5785c79 commit a2e298e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion news/changelog-1.5.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
All changes included in 1.5:
\All changes included in 1.5:

## HTML Format

Expand All @@ -13,6 +13,10 @@ All changes included in 1.5:
- ([#8294](https://github.com/quarto-dev/quarto-cli/issues/8294)): Add support for website announcements, using the `announcement` key under `website`.
- ([#8426](https://github.com/quarto-dev/quarto-cli/issues/8426)): Ignore invalid dates for references when generating Google Scholar data.

## Website Listings

- ([#8435](https://github.com/quarto-dev/quarto-cli/issues/8435)): Improve listing filtering using special characters

## Manuscripts

- ([#8277](https://github.com/quarto-dev/quarto-cli/issues/8277)): Improve notebook ordering within Manuscript projects
Expand Down
10 changes: 10 additions & 0 deletions package/src/common/update-html-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { copySync } from "fs/copy.ts";
import { info } from "log/mod.ts";
import { dirname, extname, join } from "path/mod.ts";
import { lines } from "../../../src/core/text.ts";
import * as ld from "../../../src/core/lodash.ts";

import { runCmd } from "../util/cmd.ts";
import { applyGitPatches, Repo, withRepo } from "../util/git.ts";

Expand Down Expand Up @@ -180,6 +182,14 @@ export async function updateHtmlDependencies(config: Configuration) {
join(dir, `list.js-${version}`, "dist", "list.min.js"),
listJs
);

// Omit regular expression escaping
// (Fixes https://github.com/quarto-dev/quarto-cli/issues/8435)
const contents = Deno.readTextFileSync(listJs);
const removeContent = /e=\(e=t\.utils\.toString\(e\)\.toLowerCase\(\)\)\.replace\(.*?\),/g
const cleaned = contents.replaceAll(removeContent, "");
Deno.writeTextFileSync(listJs, cleaned);

return Promise.resolve();
}
);
Expand Down
Loading

0 comments on commit a2e298e

Please sign in to comment.