Skip to content

Commit

Permalink
Use Unicode version of hostnames in element picker
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Aug 20, 2023
1 parent ed6c0d2 commit 55d068a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/js/epicker-ui.js
Expand Up @@ -26,6 +26,7 @@
import './codemirror/ubo-static-filtering.js';

import { hostnameFromURI } from './uri-utils.js';
import punycode from '../lib/punycode.js';
import * as sfp from './static-filtering-parser.js';

/******************************************************************************/
Expand Down Expand Up @@ -147,7 +148,10 @@ const renderRange = function(id, value, invert = false) {
const userFilterFromCandidate = function(filter) {
if ( filter === '' || filter === '!' ) { return; }

const hn = hostnameFromURI(docURL.href);
let hn = hostnameFromURI(docURL.href);
if ( hn.startsWith('xn--') ) {
hn = punycode.toUnicode(hn);
}

// Cosmetic filter?
if ( reCosmeticAnchor.test(filter) ) {
Expand Down

0 comments on commit 55d068a

Please sign in to comment.